运行简单的'重命名'功能时出现错误信息

时间:2015-06-22 06:49:32

标签: r rename plyr

不确定为什么这个简单的重命名功能不起作用。我一直收到此错误消息:Error: All arguments to rename must be named.我在网上搜索过,有些人在使用rename包时遇到dplyr功能问题。我不是仅使用dplyr而是plyr个包。知道如何解决这个问题吗?

library(plyr)
df <- data.frame(V1=1:3, B=4:6, C=7:9)
df
SIM.data.bystudy.median <- rename(df, c("V1"="medianS")) 
# Error: All arguments to rename must be named.

sessionInfo()的输出是:

R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] parallel  grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] doBy_4.5-13      survival_2.38-1  stringr_0.6.2    dplyr_0.4.2      data.table_1.9.4 doParallel_1.0.8 iterators_1.0.7  foreach_1.4.2   
 [9] scales_0.2.4     reshape2_1.4.1   plyr_1.8.1       ggplot2_1.0.1    shiny_0.11.1    

loaded via a namespace (and not attached):
 [1] assertthat_0.1     chron_2.3-45       codetools_0.2-10   colorspace_1.2-6   DBI_0.3.1          digest_0.6.8       gtable_0.1.2      
 [8] htmltools_0.2.6    httpuv_1.3.2       labeling_0.3       lattice_0.20-30    lazyeval_0.1.10    magrittr_1.5       MASS_7.3-39       
[15] Matrix_1.1-5       mime_0.3           munsell_0.4.2      proto_0.3-10       R6_2.0.1           RColorBrewer_1.1-2 Rcpp_0.11.5       
[22] RJSONIO_1.3-0      splines_3.1.3      tools_3.1.3        xtable_1.7-4   

0 个答案:

没有答案