1,查看R中的变量模式(对象的数据类型)mode()

2,因子(factor),  table()可以获取多个因子的交叉表,可以知道每个因子出现的次数

> g<-c("f","m","m","m","f","f","m","f","m","f")

> g<-factor(g)

> a<-factor(c("adult","junvenile","adult","adult","junvenile","adult","adult","junvenile","adult","adult"))

> table(a,g)
g
a f m
adult 3 4
junvenile 2 1

3,数据框

简单对数据框进行查询,可以用attach(detach)和subset()函数

4,查看R语言内置的数据集

用data()即可查看各种数据集

05-08 07:59