R语言 attach() detach()问题
name<-c("Zhangshan","Lisi","Wangwu","Zhaoliu")
age<-c(20,30,40,50)
onedata.frame<-data.frame(name,age)
onedata.frame
name age
1 Zhangshan 20
2 Lisi 30
3 Wangwu 40
4 Zhaoliu 50
attach(onedata.frame )
The following objects are masked by .GlobalEnv:
age, name
The following objects are masked from onedata.frame (pos = 3):
age, name
The following objects are masked from onedata.frame (pos = 4):
age, name
看过相关帖子说用with()函数可以避免这个问题
但是不太明白 使用attach()函数的问题在哪里?