I have successfully installed RStudio Server and Shiny Server using Azure VM, and able to get up the default page of sample-apps/hello.
However, when I try adding some simple code to the sample-apps/hello, it breaks.
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
# Expression that generates a histogram. The expression is
# wrapped in a call to renderPlot to indicate that:
#
# 1) It is "reactive" and therefore should be automatically
# re-executed when inputs change
# 2) Its output type is a plot
output$distPlot <- renderPlot({
x <- faithful[, 2] # Old Faithful Geyser data
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
library(downloader)
url <- "https://raw.githubusercontent.com/genomicsclass/dagdata/master/inst/extdata/msleep_ggplot2.csv"
filename <- "msleep_ggplot2.csv"
if (!file.exists(filename)) download(url,filename)
msleep <- read.csv("msleep_ggplot2.csv")
head(msleep)
})
})
I have installed libraries "downloader" and "dplyr" in RStudio.
The shiny server log says:
Listening on http://127.0.0.1:45969
Warning: Error in library: there is no package called ‘downloader’
169: stop
168: library
167: renderPlot [/srv/shiny-server/DataAnalyticsPortal/server.R#20]
165: func
125: drawPlot
111: <reactive:plotObj>
95: drawReactive
82: origRenderFunc
81: output$distPlot
1: runApp
Can anyone help?
Thanks.