510,863 questions
0
votes
0
answers
43
views
Implementing image axis labels with ggplot2 + plotly
My goal is to make a bar plot with images as axis labels, like this (screen 1). I also want plotly's chart annotations, but adding plotly to the program causes the axis labels to be interpreted as raw ...
-1
votes
1
answer
63
views
lapply() can't find variables in dataframes [closed]
I have created a list of dataframes using the split() function in R. Eventually I want to look at various analyses on each of these datasets, but I'm just trying to understand the basic use of lapply()...
0
votes
0
answers
59
views
How to find last occurences of certain column values in Data Frame for many such values in R?
I am looking to find the last message for a certain set of authors, that is, the last message for each one of the authors in a special set, and to return such final messages in a data frame.
I already ...
0
votes
0
answers
24
views
Fatal error: Unexpected exception: boost::filesystem:: canonical: Access is denied [system:5]: [closed]
I have been having a problem for the past two weeks where every time I try to open Rstudio, I get an error message saying
"Fatal error: Unexpected exception: boost::filesystem::canonical: Access ...
6
votes
1
answer
168
views
Why `as.POSIXlt("1994-01-01")` returns an error?
Does anyone know why as.POSIXlt("1994-01-01") returns the following error:
Error in as.POSIXlt.character("1994-01-01"):
character string is not in a standard unambiguous format
...
0
votes
0
answers
52
views
Issue reading google sheets data in R
I am working in a collaborative group around the world (different institutions) and we are trying to work on a synthesis project. We store our data in a shared Google Drive, meaning those files are in ...
0
votes
0
answers
43
views
Is inline code to generate tables in report bad practice? [closed]
I'm using R Markdown to share results with colleagues who aren't familiar with coding for data analysis.
The aim is to make the analysis transparent while keeping the output more readable for them, I'...
5
votes
5
answers
126
views
Conditional counting based on multiple conditions
I have a tidy ecological dataset in which every row is a single specimen/individual, with multiple columns for multiple variables.
#fake dataset
loc <- c(1,1,2,2,2,3,3,3,3,3,3,3,3)
date <- c(...
0
votes
1
answer
42
views
Nested slurm jobs in R using future.batchtools
I am trying to test future.batchtools for parallelisation in R.
I have a small test job (run_futurebatchtools_job.R) as:
library(future)
library(future.batchtools)
# Set up the future plan to use ...
2
votes
2
answers
85
views
R data.table rolling join with limit window in number of data points
dates = as.Date(c('2000-01-01','2000-02-01','2000-03-01','2000-04-01'))
dt = data.table(date = dates[1:2], value = c(1,2))
> dt
date value
<Date> <num>
1: 2000-01-01 ...
-3
votes
1
answer
54
views
Knn not running? [closed]
I am working on a problem where we had to use k-fold cross validation with a knn model. I was successfully able to train the model and determine that k=15 had the best accuracy. However when I try to ...
1
vote
2
answers
102
views
"Subscript out of bounds" on a time series in R
Time series data to measure employment from United States Bureau of Labor Statistics (first ten rows shown):
> Time_Series
# A tsibble: 115 x 8 [1M]
year month value Year Month Date1 ...
4
votes
6
answers
344
views
How to get the highest values for two unrelated columns?
Let's say I have a data.table that looks like this:
library(data.table)
dt <-
rowwiseDT(
group=, a=, b=,
"a", 1, 10,
"a", 10, 1,
"a", 9, 9,
&...
0
votes
0
answers
40
views
Regress out effect of one variable [migrated]
I have an outcome y and two variables e.g. sex and age.
I want to plot two ggplot2 boxplots with the outcome y and sex. However, I would like before that "regress out" the effect of age.
I ...
1
vote
2
answers
78
views
Replicate rows in data.table using passed column names in user defined function environment
I'm passing a data table to a function I've defined where I want the function to replicate rows that meet a certain condition and the return the updated data table. I'm having trouble constructing it ...