Extracting Coefficients, Std Errors, R2 etc from multiple regressions
I have the following regression model;models <- lapply(1:25, function(x) lm(Y_df[,x] ~ X1)) Which runs 25 regressions on 25 columns in the Y_df dataframe.One of the outputs can be shown...
View ArticleTrying to install fast qc in R
I'm trying to install fastqc in R to construct a RNA-Seq analysis pipeline, I've tried everything and when I try to install it using "install.packages("fastqc")" I get the following error message:...
View ArticleCount observations per group satisfying a different condition for each row
I have a dataframe that looks like this onestate start end date treat 1 1999 2000 2001 1 1 1998 2000 2001 1 1 2000 2003 NA 0 2 2001 2002 NA 0 2 2002 2004 2003 1 2 2003 2004 2005 1 3 2002 2004 2006 1 3...
View ArticleHow can I make large additions to textstem's lexicon in R?
I have a large body of free-text survey comments that I'm attempting to analyze. I used the textstem package to perform lemmatization, but after looking at the unique tokens it identified I'd like to...
View ArticleShiny not detecting input in output
If I run the following code, everything runs fine: library(dplyr) library(tidyr) library(shiny) id <- 1:100 gender <- sample(c('M','F'), 100, replace=TRUE) age <- sample(18:22, 100,...
View ArticleApply same function on same object, with different parameters -- the tidy way
I would like to apply iteratively the same function (in the example, my_function) to the same object (here, my_matrix) with different parameters (my_parameters) stored in a list, or something...
View ArticleMerging more than 2 dataframes in R by rownames
I gather data from 4 df's and would like to merge them by rownames. I am looking for an efficient way to do this. This is a simplified version of the data I have. df1 <- data.frame(N= sample(seq(9,...
View ArticleFilter by Groups in R
I have a large dataset of claims data. I would like to filter out multiple claims from the same claimant (i.e. ExternalLeaveId1) based on the maximum MaxApprovedDate and the minimum MinApprovedDate....
View ArticleHow to use different font sizes in ggplot facet wrap labels?
I want to create two different sizes of text in the labels of my facet wrap.For example:Species X (size 14)Total catch (n=133) (size 12)test <- read.csv(paste0(path, "Costello Artvgl2 for...
View ArticleSimilarity as edge attribute in iGraph
Lets say we have some graph g and then we compute some similarity between each pair of nodes from g: g <- graph.ring(10) g_sim <- similarity.dice(g) The question is: how to use data from g_sim to...
View Articlefs full extent R graphics device
I am starting to explore the sf package and have a question about geom_sf(). All of my spatial plots render nicely filling the complete R plotting device, however, when I use geom_sf() in ggplot2 it...
View Articlein R: how to take value from Nth cell and subtract from every cell in Nth column
Let's say I have a dataset that looks as follows:subvalues <- c(1:10)df <- data.frame(x = rpois(40,2), y = rpois(40,2), z = rpois(40,2))I want to take the value from the first cell of subvalues...
View ArticleR install.packages("PackageName") no response, timeout [closed]
I am running R on an AWS ubuntu instance. I have completely uninstalled and purged R, deleted libPaths followed by re-installation of r-base. Whenever I try to install.packages() for any package R sits...
View ArticleExtract data from pdf files with R
I am trying to extract data (tables) from pdf files and store them as data frames. library(pdftools) library(tabulizerjars) library(tabulizer) library(tidyverse) f <-...
View ArticleFilter to a specific date within a specific column
I have a dataframe, df with column DateTimeUTC. ID DateTimeUTC A 12/4/2019 11:30:30 PM A 12/4/2019 11:30:30 PM B 12/5/2019 11:30:30 PM B 12/5/2019 11:30:30 PM B 12/5/2019 11:30:30 PM I would like to...
View ArticleUnpredictable results using cut() function in R to convert dates to 15 minute...
OK, this is making me crazy.I have several datasets with time values that need to be rolled up into 15 minute intervals.I found a solution here that works beautifully on one dataset. But on the next...
View ArticleX-axis tick labels different font size and font face ggplot
I am trying to change the font size and face of x-axis tick labels based on the line. The label on 1st line to bold and 12 and label on 2nd line to regular and 8. structure(list(`501` = c(0, 0, 0, 0,...
View ArticleR memoise on Linux server
I'm testing memoise to cache a big dataframe in a R shiny application. It works totally fine on my local windows machine but as soon as I deploy the code on the Linux server, somehow it seems memoise...
View ArticleHow to add a "favorability" direction variable to a linear model in R?...
I'm working on a modeling problem using multiple regression in R. I'm having trouble wrapping my head around how to build a linear model to capture a certain kind of data.My data consists of three...
View ArticleTimeseries and R language
I have a file txt that every line is a sequence of data(numbers) separated with comma like 3,3,3,3,3,2,34,5 10,11,23,22,2,2,2,2,45,67 I need to read every line with R as time series and plot the result.
View Article