gl(base) gl()所属R语言包:base Generate Factor Levels 生成因子水平 译者:生物统计家园网 机器人LoveR 描述----------Description---------- Generate factors by specifying the pattern of their levels. 通过指定水平的格局产生的因素。 用法----------Usage---------- gl(n, k, length = n*k, labels = 1:n, ordered = FALSE) 参数----------Arguments---------- 参数: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. 一个逻辑结果是否应当责令与否。 值----------Value---------- The result has levels from 1 to n with each value replicated in groups of length k out to a total length of length. 结果水平从1n长度k总长度的length组复制的每个值。 gl is modelled on the GLIM function of the same name. gl为蓝本的同名GLIM功能。 参见----------See Also---------- The underlying factor(). 底层factor()。 举例----------Examples---------- ## First control, then treatment:[#首先控制,然后处理:] gl(2, 8, labels = c("Control", "Treat")) ## 20 alternating 1s and 2s[#20交替1S和2S] gl(2, 1, 20) ## alternating pairs of 1s and 2s[#1和2交替对] gl(2, 2, 20) 转载请注明:出自 生物统计家园网(http://www.)。 注: 注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。 注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。 注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。 |
|