dfs列表:
catbehave <- c("Good", "Cute", "Evil")
catnum <- c(1, 2, 3)
dogbehave <- c("Goodboi", "Cute")
dognum <- c(4, 2)
mousebehave <- c("Evil", "Good", "Cute")
mousenum <- c(3, 1, 2)
cat <- as.data.frame(cbind(catbehave, catnum))
dog <- as.data.frame(cbind(dogbehave, dognum))
mouse <- as.data.frame(cbind(mousebehave, mousenum))
list.1 <- list(cat = cat,dog = dog,mouse = mouse)
df1:
cat <- c("Good", "Evil", "Evil", "Cute")
dog <- c("Goodboi", "Goodboi", "Cute", "Goodboi")
mouse<- c("Evil", "Good", "Cute", "Evil")
df1 = data.frame(cat, dog, mouse)
我希望评估一系列数据框以更改 df1
中的值。需要在 list.1
中使用数据框的名称作为 df1
的列名。
输出:
df1
cat dog mouse
1 4 3
3 4 1
3 2 2
2 4 3