代码如下:
student<-c("john davis","angela williams","bullwinkle moose","david jones",
"janice markhammer","cheryl cushing","reuven ytzrhak","greg konx",
"joel england","mary rayburn")
math<-c(502,600,412,358,495,512,410,625,573,522)
science<-c(95,99,80,82,75,85,80,95,89,86)
english<-c(25,22,18,15,20,28,15,30,27,18)
roster<-data.frame(student,math,science,english,stringAsFactors=FALSE)
结果:(1)roster中student被转换成了因子
> is.factor(roster$student)
[1] TRUE
(2)roster中多了一个变量“stringAsFactors”
ter
student math science english stringAsFactors
1 john davis 502 95 25 FALSE
2 angela williams 600 99 22 FALSE
3 bullwinkle moose 412 80 18 FALSE
4 david jones 358 82 15 FALSE
5 janice markhammer 495 75 20 FALSE
6 cheryl cushing 512 85 28 FALSE
7 reuven ytzrhak 410 80 15 FALSE
8 greg konx 625 95 30 FALSE
9 joel england 573 89 27 FALSE
10 mary rayburn 522 86 18 FALSE
>
请问各位大神这是什么情况?


雷达卡




京公网安备 11010802022788号







