R语言:gl()函数
来源:互联网 发布:淘宝警用伸缩警棍价格 编辑:程序博客网 时间:2024/05/17 07:11
gl(base)
gl()所属R语言包:base ;Generate Factor Levels,生成因子水平
Generate factors by specifying the pattern of their levels.
通过指定水平的格局产生的因素。
用法----------Usage----------
gl(n, k, length = n*k, labels = 1:n, ordered = FALSE)
参数:n
an integer giving the number of levels.
整数的级别(因子)数。
参数:k
an integer giving the number of replications.
一个整数,重复数。
参数:length
an integer giving the length of the result.
一个整数,结果的长度。
参数:labels
an optional vector of labels for the resulting factor levels.
可选的向量因子水平的标签。
参数:ordered
a logical indicating whether the result should be ordered or not.
一个逻辑表明是否排序
返回值为 因子长度从1到n,k为length组复制的每个值。
## First control, then treatment:gl(2, 8, labels = c("Control", "Treat"))## 20 alternating 1s and 2sgl(2, 1, 20)## alternating pairs of 1s and 2sgl(2, 2, 20)
1 0
- R语言:gl()函数
- R语言常用函数
- R语言常用函数
- R语言常用函数
- R语言函数
- R语言函数
- R语言常用函数
- C语言函数---R
- R语言函数
- R语言table()函数
- R语言-时间函数
- R语言paste函数
- R语言table函数
- R语言try函数
- R语言常用函数
- R语言:自定义函数
- R语言diag函数
- R语言readLines函数
- 关于线程局部存储代码出错分析讨论
- JS数组,字典
- Java应用程序将对象分配到堆
- Swift语言精要 - Dictionary(字典)
- oracle扩展表空间以及清空临时表
- R语言:gl()函数
- 【那些年遇到过的面试题】traceroute和tracert有什么区别
- JAX-RS入门 一 :基础
- Hibernate注解使用以及Spring整合
- 初学mysql & python & python链接数据库(mysql) & mysql for linux
- Word神操作,不只是快捷键
- Java-3
- LeetCode - 73. Set Matrix Zeros
- 这个browse()方法可能抛出各种类型的异常