标签: r
我想分开角色:
v <- "a, b, c, d"
因此,向量的长度为4
v <- c("a", "b", "c", "d")
答案 0 :(得分:4)
unlist()将列表转换为字符数组
unlist()
v = unlist(as.vector(strsplit(x = v, split = ",")))