我正在使用R.
我有以下数据:
library(fastLink)
a = data.frame(dfA)
head(a)
firstname middlename lastname housenum streetname city birthyear
1 daniel joseph secuya 1564 fairview ct Oakland 1957
2 david marion motakabbir 6909 shepherd ave apt 4 Oakland 1971
3 joseph aaron joseph 4547 piedmont ave Castro Valley 1948
4 joseph clyde mcnulty 30436 49th ave Castro Valley 1961
5 akensheye nguyen paniagua chavez 6967 glenwood dr Oakland 1972
6 john <NA> bozman 6363 nabor st Livermore 1951
从这里开始,我试图从这个表中选择行;名字";包含字母";jo";。我试着用";grep";命令:
a[grep("jo", a$firstname)]
Error in `[.data.frame`(a, grep("jo", a$firstname)) :
undefined columns selected
有人知道为什么会出现这个错误吗?
感谢
final = a[grep("cl", a$firstname),]
这似乎已经解决了!谢谢大家!