我在下面列出了一个 list ,我不想做的是将df2
中的class(Category)
改为class(Category)
.代码应该更改类(类别),并在list()
对象中为其分配类别.如何绕过这一点?在此之前,我非常感谢您.
df1 <- data_frame(ID = paste0(LETTERS[1],1:4), valueA = seq(0.1,0.4,0.1), Category= "Apples" )
df2 <- data_frame(ID = paste0(LETTERS[1],5:8), valueB = seq(0.1,0.4,0.1), Category= seq(0.1,0.4,0.1))
df3 <- data_frame(ID = paste0(LETTERS[1],9:12), valueC = seq(0.1,0.4,0.1), Category= "Apples3")
list1 <- list(df1, df2, df3);list1
bind_rows(list1)
Error in `bind_rows()`:
! Can't combine `..1$Category` <character> and `..2$Category` <double>.
Run `rlang::last_trace()` to see where the error occurred.