我想对变量进行逻辑转换,指定上边界和下边界。我试图复制gregmisc package中的“logit”函数:
library(gregmisc)
x <- seq(0,10, by=0.25)
xt <- logit(x, min=0, max=10)
但是我收到一条错误消息:
Error in logit(x, min = 0, max = 10) :
unused argument(s) (min = 0, max = 10)
是什么给出的? (P.S. gtools也不起作用。)
这是sessionInfo():
> library(gregmisc)
+ x <- seq(0,10, by=0.25)
+ xt <- logit(x, min=0, max=10)
Error in logit(x, min = 0, max = 10) :
unused argument(s) (min = 0, max = 10)
> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8
[9] LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] splines grid stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] car_2.0-10 survival_2.36-9 nnet_7.3-1 MASS_7.3-13
[5] gregmisc_2.1.1 gplots_2.8.0 caTools_1.12 bitops_1.0-4.1
[9] gtools_2.6.2 gmodels_2.15.1 gdata_2.8.2 foreign_0.8-44
[13] rkward_0.5.6
loaded via a namespace (and not attached):
[1] tools_2.13.0