Hi
I am new to shiny and trying to publish my first app on shinyapps.io.
Once I publish the app and launch it I get this error:
Error in value[3L] : there is no package called ‘ggplot2’
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
Execution halted
I past almost 2 days surfing the internet and I think I tried all suggested solutions. I did my app in 2 files (app.R and global.R) and then in 3 files (server.R, ui.R and global.R).
I am not sure why the packages are not recognize when I publish it.
In my global.R file I have all the libraries that I need and that is also where I called my dataset and process all the necessary cleaning steps:
library(shiny)
library(ggplot2)
library(plotly)
library(reshape2)df = read.csv('countries-aggregated.csv',
header = TRUE, na.strings=c("","NA"), sep = ",")df$Actif = df$Confirmed - df$Recovered - df$Deaths
cases = aggregate(list(cases=df$Confirmed), by=list(Date=as.Date(df$Date)), FUN=sum)
deaths = aggregate(list(deaths=df$Deaths), by=list(Date=as.Date(df$Date)), FUN=sum)
recovered = aggregate(list(recovered=df$Recovered), by=list(Date=as.Date(df$Date)), FUN=sum, na.rm=TRUE)
cases$NewCases <- ave(cases$cases, FUN=function(x) c(0, diff(x)))
deaths$NewDeaths <- ave(deaths$deaths, FUN=function(x) c(0, diff(x)))
recovered$NewRec <- ave(recovered$recovered, FUN=function(x) c(0, diff(x)))newdf = cbind(Date=as.Date(cases$Date), cases[2:3], deaths[2:3], recovered[2:3])
newdf$Actif = newdf$cases - newdf$deaths - newdf$recovered
dfz = as.data.frame(cbind(Date = as.Date(newdf$Date), "Cas confirmés" = newdf$cases, Décès = newdf$deaths, Guéris = newdf$recovered, "Cas actif" = newdf$Actif))
dfz$Date = as.Date(newdf$Date)
Molten <- melt(dfz, id.vars = "Date")
dfz2 = as.data.frame(cbind(Date = as.Date(newdf$Date), "Nouveau Cas" = newdf$NewCases, "Décès" = newdf$NewDeaths, "Guéris" = newdf$NewRec))
dfz2$Date = as.Date(newdf$Date)
Molten2 <- melt(dfz2, id.vars = "Date")
Any help would be appreciated. I don't know if it is related to the way I called my dataset or I have extra step to do to make shinyapps to recognize the library I am using