R编程因素(R programming Factors)

R编程因素(R programming Factors)
返回programming,Factors,因素常用代码示例代码片段
# Create a vector.
apple_colors <- c('green','green','yellow','red','red','red','green')

# Create a factor object.
factor_apple <- factor(apple_colors)

# Print the factor.
print(factor_apple)
print(nlevels(factor_apple))
原文链接:https://rumenz.com/examples/rscript/r-programming-factors.html
点击下面标题即可获取对应PDF资料
↑回到顶部↑
入门小站 @2018