我对R来说比较新。我正在尝试创建一个应用程序,通过R Shiny界面将用户输入并将其复制到名为" DirectEffect&#34的Excel电子表格中;。这是代码:
library(shiny)
library(xlsx)
ui <- fluidPage(
numericInput(inputId = "num",
label = "Choose a number",
min = 0, max = 1000000, value = 1),
actionButton(inputId = "submit",
label = "Submit")
)
server <- function(input, output) {
options(java.parameters = "- Xmx1024m")
wb <- loadWorkbook(file = "F:\\RProject-Rough\\DirectEffect.xlsx")
sheet<-getSheets(wb)
observeEvent(input$submit,
{
addDataFrame(input$submit, sheet$'Direct Effects',col.names=FALSE, row.names=FALSE, startRow = 3,startColumn=5)
saveWorkbook(wb,"F:\\RProject-Rough\\DirectEffect.xlsx")
}
)
}
shinyApp(ui = ui, server = server)
我的问题是这些:
你能看出我的错误在哪里,以及我如何解决它?