> table(x)
x
male female
2 3
> unclass(x)
[1] 2 2 1 1 2
attr(,"levels")
[1] "male" "female"
> class(unclass(x))
[1] "integer"
> ?table
> ?unclass
> ?class(unclass)
?table ?unclass ?class(unclass)在控制台查找 再操作大概就懂了
table(x)检查列表属性unclass(x)去除列表属性