问题如下:
patientID<-c(1,2,3,4)
age<-c(25,34,28,52)
diabetes<-c("Type1","Type2","Type1","Type1")
status<-c("Poor","Improved","Excellent","Poor")
diabetes<-factor(diabetes)
status<-factor(status,order=TRUE)
patientdata<-data.frame(patientID,age,diabetes,status)
patientdata
attach(patientdata)
会出现如下问题
The following objects are masked _by_ .GlobalEnv:
age, diabetes, patientID, status
The following objects are masked from patientdata (pos = 3):
age, diabetes, patientID, status
为什么patientdata无法绑定attach呢,是因为age, diabetes, patientID, status的赋值已经算一个环境变量,然后输出的patientdata的数据框算作另一个环境变量吗?无法理解,望大神解答。 |