-1
我有个字符向量:独立数据
A <- c("terrestrial human",
"animal 7 planet",
"geographic 23 locations",
"discovery kids")
我想此分离成两个向量:一个具有包含数字的所有条目,并且没有任何数字的其它含数据。
v1 <- c("animal 7 planet","geographic 23 locations")
v2 <- c("terrestrial human","discovery kids")
您是否尝试过使用'grepl'? – TheComeOnMan
请提供[可重现的示例](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)。 – Thomas
你似乎有一个向量。 “x < - c”(“陆地人类”,“动物7星球”,“地理位置23”,“发现孩子”); split(x,grepl(“[0-9]”,m))' –