Analyzing temporally correlated data using 'date' as a fixed effect; do you...
The short and sweet of the question is this: How do you deal with time as a parameter in an repeat ANOVA in R?I have repeat observations of the number of plants growing in pots taken at 3 day, 7 day,...
View ArticleCreate columns in a dataframe as a sum of previous columns for a bar chart...
I am trying to calculate tax payments, made by companies each year, and show the sum of totally paid taxes after each year, using previous years and summarizing them.After doing this, I want to show...
View ArticleRidge plot curves not appearing in plot in r
I'm trying to recreate this ridge plot:https://i.stack.imgur.com/QAFs1.jpgHowever, I can't seem to be able to get the curves to show up on the plot, As you may have guessed I'm very new to r, so I...
View ArticleDifferent accuracy for python (Scikit-Learn) and R (e1071)
For the same dataset (here Bupa) and parameters i get different accuracies.What did I overlook?R implementation:data_file = "bupa.data" dataset = read.csv(data_file, header = FALSE) nobs <-...
View Articlewhat function/package conflicts with dplyr in R?
dplyr used to work without issue, recently it seems to be in conflict with some other package I loaded. I didn't use plyr or MASS. mtcars%>%select(mpg) Error in select(., mpg) : unused argument...
View ArticleRun Multiple Windows System Commands Interactively From Within R
I am trying to build an R package for Windows 10 that will allow me to use the Secure File Transfer Protocol (SFTP) client of PuTTY, PSFTP from within the R console to transfer files back and forth to...
View ArticleBeamer and Table of Content in RMarkdown
Today I started studying Rmarkdown + Beamer. I have a problem creating the table of contents.I create this way:--- title: "Beamer" author: "Me" date: "08/08/2019" output: beamer_presentation --- ```{r...
View ArticleHow to merging R based on various column info and only one unique id
I m trying to merge 2 datasets:dataset 1 id, month, year, postal dataset 2 id, month, year, postal, Income, name, division dataset 1 id year month postal 1 2010 9 j0r1h0 2 2010 8 j0r1h0 .... .... 7...
View Articlepassing several arguments to FUN of lapply (and others *apply)
I have a question regarding passing multiple arguments to a function, when using lapply in R. When I use lapply with the syntax of lapply(input, myfun); - this is easily understandable, and I can...
View ArticleShiny fileInput Issue
After a CSV file is loaded into shiny app it closes the browser. No messages deisplayedI have tested this in Chrome Version 75.0.3770.90, Edge and Firefox 70.0.1. This code use to work before. I am...
View ArticleLabel grouped bar plot in R
I'm tryng to add label to a grouped bar plot in r. However I'm using percentege in the y axis, and I want the label to be count. I've tried to use the geom_text() function, but I don't how exacly the...
View ArticleKeep rows until a specific timestamp even if the last one does not exists
Having a data frame which provides a specific timestampdframe1 <- structure(list(id = c(1L, 1L, 1L, 2L, 2L), name = c("Google", "Yahoo", "Amazon", "Amazon", "Google"), date = c("2008-11-01",...
View ArticleWhy does `substitute` work in multiple lines, but not in a single line?
I was attempting to answer this nice question about creating a non-standard evaluating function for a data.table object, doing a grouped sum. Akrun came up with a lovely answer which I'll simplify...
View Articlesome fonts not available for pdf or postscript device in extrafont
In order to use different fonts for my plots, I installed the extrafont package on my Win10 machine. I run the following code:library (extrafont) font_import () loadfonts (device = "win") which works...
View ArticleHow to extract elements from nested list in R
I'm working with json data which I've converted into a tibble with some list columns. I'm trying to extract the useful information from the list columns but am facing issues. If given the following...
View ArticleSummaizing using dplyr with a for loop
I would like to summarise each of my independant variables(Columns) with my target variable using dplyr over a for loop This is my main dataframe contract_ID Asurion Variable_1 Variable_2 Variable_3 1...
View ArticleConditional Flow in R? [closed]
I have a vector with ~5k observations, I'd like to group them in 4 categories, 4 if the observation<-2, 3 if [-2,0], 1 if (0,2], 2 if greater than 2. I'd like to have the corresponding group code in...
View ArticleFilter only EQUAL values into columns with dplyr::filter_if
I have following data:df <- data.frame( x = c(1, 4, 3, 4, 4, 3), y = c(2, 3, 4, 4, 2, 3) ) I try use this code:library(tidyverse) df %>% filter_if(~ is.numeric(.), all_vars(. %in% c('3', '4'))) x...
View Articleggplot2 geom_jitterdodge points and with overlayed dodged boxplots: I want to...
Using ggplot2, I want to geom_jitterdodge a swarm of points with overlayed dodged boxplots. The trick is that I want the boxplots to be black, not colored like the points. The point plot looks like...
View ArticleR: Summarize rows per month
I have made a dataframe which has a column with dates and columns with numeric values. I want this dataframe to group itself by month and summerize all the numeric values from the other columns per...
View Article