I am trying to write an Excel file using the Shiny app, on a Server. First step is just getting the package to load, I am using readXL as an example because a( its single line syntax and b) there are no unusual dependencies (looking at you Java).
First of all, my problem is having this run on a server, it runs on my Mac but not on any external server. I have tried Centos7, an EC2 running Ubuntu and an EC2 running Amazons Redhat based linux flavour. The problem seems to be allowing the Shiny server access (more on this later).
Here is some example code below. The .XLSX here is in my working directory. server.r
#library(openxlsx)
library(shiny)
library(readxl)
#library(abbyyR)
function(input, output) {
a <- readxl::read_excel("test.xlsx")
output$testXL <- renderTable(a)
}
ui.r
fluidPage(
titlePanel("Conditional panels"),
column(4, tableOutput("testXL")
)
)
In all cases, the conditional panel loads but not the data. If I run this app in R-Studio GUI and launch it using the local machine (tried all three) as a server, I can access it via the specified IP and Port (ie the below is accessible on x.x.x.x:5050.
>runApp(host="0.0.0.0",port=5050)
However placing this file in the server files (I've followed the standard setup - files under /srv/shiny-server/AppName) the server is disconnected. Taking out the readXL based code (inc loading the library) prevents a disconnect from server message.
I have tried openxlsx, XLSX and XLConnect, all fail when library(packageName) is included. The local directory has had RWX permissions applied to all user.
Any ideas?