R语言:gl()函数
2016-06-30 17:30
393 查看
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组复制的每个值。
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 2s gl(2, 1, 20) ## alternating pairs of 1s and 2s gl(2, 2, 20)
相关文章推荐
- java 内部类(inner class)详解
- lazarus:一个字体引擎例子
- oracle使用数据泵导入导出数据
- sql好文分享
- SpringMVC利用MultipartFile进行文件上传
- 浅谈Redis的键值设计
- Maven+SpringMVC+MyBatis的环境搭建(二)
- ios 跨页返回,从navigationController 删除指定页面
- 【Struts2】:Struts2的类型转换
- JAX-RS入门 四: 注入
- Java 基础部面试
- Linux命令--dmesg
- OPenCV学习笔记(5)——图像缩放
- 初学mysql & python & python链接数据库(mysql) & mysql for linux
- java学习笔记——maven
- 测试App运行状态
- @RestController
- 关于APP接口设计 注意事项
- 在C语言中,double、long、unsigned、int、char类型数据所占字节数
- java中变量什么时候需要初始化