将Excel列中的Excel值存储到bert中的variables中

我目前只是试图在Excel中获得BERT控制台的挂起,并且在将数据集Iris中的值存储到variables中的简单function方面遇到了麻烦。 我正在使用来自bert的示例脚本,如下所示:

# # Here's an example of using the Excel scripting interface # (paste this code into the shell). # # For more information, see # # https://bert-toolkit.com/excel-scripting-interface-in-r # # # get a reference to the workbook # wb <- EXCEL$Application$get_ActiveWorkbook(); # # add a sheet # new.sheet <- wb$get_Sheets()$Add(); # # change the name of the new sheet. note that this will # fail if a sheet with this name already exists. # new.sheet$put_Name( "R Data Set" ); # # add some data. use matrices. # range <- new.sheet$get_Range( "B3:F152" ); range$put_Value( as.matrix( iris )); # # add column headers # header.range <- new.sheet$get_Range( "B2:F2" ); header.range$put_Value( t( colnames( iris ))); # # resize columns to fit # range$get_EntireColumn()$AutoFit(); # # example of using constants: add border (underline) to headers # borders <- header.range$get_Borders(); border <- borders$get_Item( EXCEL$XlBordersIndex$xlEdgeBottom ); border$put_Weight( EXCEL$XlBorderWeight$xlThin ); 

在单元格中的数字格式是通用的,我想将列B的值存储到一个variables,所以我可以操纵这些值。 这是我testing的代码获取列B中的值,并将其放在列G:

 col.B <- list("B3:B152"); test.input <- new.sheet$get_Range( "G3:G152" ); test.input$put_Value(); 

命令行中的输出为TRUE,并且没有错误,但值不粘贴到G列中。我在做什么错了?

在运行第一个代码块之后给定设置,此代码将数据从B列复制到G列:

 da_ta <- new.sheet$get_Range("B3:B152")$get_Value() new.sheet$get_Range("G3:G152")$put_Value(da_ta)