我有dataframe
名为perceptionAvailInfo
,其中包含以下列,我希望通过以下列重复 - >
names(perceptionAvailInfo)
## [1] "email" "HomeAddress" "HomePhone" "Cellphone"
## [5] "Employer" "PoliticalAffln" "WrittenWorks" "Photo"
## [9] "Video" "Groups" "Birthdate" "sex"
## [13] "age" "employ"
我的代码如下 - >
for (i in names(perceptionAvailInfo)) {
perceptionAvailInfo[i]
}
我尝试在for循环中仅打印i
,perceptionAvailInfo
等,但我没有看到forloop的任何输出。我错过了什么?
答案 0 :(得分:0)
这对你有用吗?
for (i in names(perceptionAvailInfo)) {
print(i)
}