While running plotDensities, I continued to get an error:
"Error in rep(x = i, times = nrow(data[[type]][[i]])) :
invalid 'times' argument"
The error came from line 137:
dfs[[type]]$Batch <- unlist(lapply(batch_names,
function(i) rep(x = I,
times = nrow(data[[type]][[i]]))))
I found this was because the length of the batch_names was inconsistent with the number of input files for each 'data type' (original or normalized) as the batch_names object takes all the input names. Upon changing batch_names to names(data[[type]]) (see below), this resolved the issue because it only called for the batch_names in each 'data type'.
Working line:
dfs[[type]]$Batch <- unlist(lapply(names(data[[type]]),
function(i) rep(x = I,
times = nrow(data[[type]][[i]]))))
I just wanted to share this in case others have had the issue.
While running plotDensities, I continued to get an error:
"Error in rep(x = i, times = nrow(data[[type]][[i]])) :
invalid 'times' argument"
The error came from line 137:
I found this was because the length of the batch_names was inconsistent with the number of input files for each 'data type' (original or normalized) as the batch_names object takes all the input names. Upon changing batch_names to names(data[[type]]) (see below), this resolved the issue because it only called for the batch_names in each 'data type'.
Working line:
I just wanted to share this in case others have had the issue.