I am trying to combine multiple data frames using rbind. If I call rbind directy, no problem:
> test <- rbind(x)
> is.data.frame(x)
[1] TRUE
however, if I use do.call, I run into a problem when my character columns are reset and the dataframe is converted to a matrix.
>test <- do.call("rbind", x)
> is.data.frame(test)
[1] FALSE
According to the documentation? I tried rbind add stringsAsFactors = FALSE, but no change in behavior. My data tables look something like this:
ID sequence descriptor
1 aaacccttt g12
2 actttgtgt e34
3 tttgggctc b12
4 ccgcgcgcg c12
โฆ โฆ ...
and the rbind output looks like this, but the output do.call("rbind", x)looks like this, where the sequence column is no longer a character:
ID 363 426 91
Sequence 98 353 100
descriptor g12 b12 c12
do.call, , script . , .
stringsAsFactors = FALSE
dfs <- as.list(ls(pattern="Data_"))
for (i in 1:length(dfs)) {
x <- get(as.character(dfs[i]))
AllData <- do.call("rbind", x)
}
dfs - , get
.