第一章 实用R内置数据进行数据处理--笔记

x1<-c(2.5,1.4,6.3,4.6,9.0)
class(x1)
mode(x1)
length(x1)
x2<-c(TRUE,FALSE,TRUE,FALSE,FALSE)
class(x2)
mode(x2)
x3<-c("DataMining","Statistics","Analytics","Projects","MachineLearning")
class(x3)
length(x3)
 a <- c('Male','Male','Female','Female','Male','Male',
+ 'Male','Female','Male','Female')
mode(a)
factor(a)
x<-data.frame(x1,x2,x3)
class(x)

[1] "data.frame"

print(x)

   x1    x2              x3
1 2.5  TRUE      DataMining
2 1.4 FALSE      Statistics
3 6.3  TRUE       Analytics
4 4.6 FALSE        Projects
5 9.0 FALSE MachineLearning

ls()
 [1] "a"          "airquality" "f"          "fit"        "q"         
 [6] "x"          "x1"         "x2"         "x3"         "y" 


你可能感兴趣的:(计算机,数据挖掘)