-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))' –