DF1 <- DF[DF$cat == 'A', ]
DF2 <- DF[DF$cat == 'B', ]
RDF <- rbind(DF1, DF2)
有没有办法以更直接的方式表达这一点,例如
RDF <- DF[DF$ cat == c('A','B'), ] # Does not work
DF1 <- DF[DF$cat == 'A', ]
DF2 <- DF[DF$cat == 'B', ]
RDF <- rbind(DF1, DF2)
有没有办法以更直接的方式表达这一点,例如
RDF <- DF[DF$ cat == c('A','B'), ] # Does not work