【发布时间】:2017-07-11 14:26:48
【问题描述】:
我正在使用 R 中的 xlsx 包创建一个新的 Excel 工作簿,然后在该工作簿中创建一个新的 Excel 工作表以将数据发送到。当我最后一次运行我的代码时,没有任何问题。现在,当我运行它时,出现以下错误: as.vector(x, "character") 中的错误: 无法将类型“环境”强制转换为“字符”类型的向量
对于我运行的任何示例,我都会遇到相同的错误。谁能帮我找出这个错误。
R 代码
library(xlsx)
#create wrokbook
lengthdatacheckwb<-createWorkbook ()
#create sheet
nolengthsheet <- createSheet(wb=lengthdatacheckwb, sheetName="No Length")
R 信息
R version 3.3.2 (2016-10-31)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] datasets utils stats graphics grDevices methods base
other attached packages:
[1] openxlsx_4.0.17 plyr_1.8.4 xlsx_0.5.7
[4] xlsxjars_0.6.1 rJava_0.9-8 MASS_7.3-45
[7] RODBC_1.3-14 latticeExtra_0.6-28 RColorBrewer_1.1-2
[10] lattice_0.20-34
loaded via a namespace (and not attached):
[1] tools_3.3.2 Rcpp_0.12.11 grid_3.3.2
【问题讨论】: