I'm trying to convert a Shiny app into an R package and I am having trouble with all things regarding the www directory as well as "loose" files.
My shiny app works perfectly but when I try to "package it", it doesn't work.
My shiny app directory:
+---my_shiny
| +---app.R
| +---utils.R
| +---www
| +---style.css
| +---icon1.png
| +---icon2.png
| +---icon3.png
| +---font.ttf
My code starts like this:
library(hrbrthemes)
library(tidyverse)
library(plotly)
source(here::here("utils.R"))
theme_set(theme_personalized())
update_geom_defaults("text", list(family = theme_get()$text$family))
ui <- navbarPage(
"Example",
id = "navbar",
theme = "style.css",
Now I down't know how to convert it into a package where I can call myapp::appdemo() and it deploys my app.
+---myapp
| +---DESCRIPTION
| +---NAMESPACE
| +---R
| +---appdemo.R
| +---inst
| +---shiny/
| +---app.R
| +---utils.R
| +---style.css
| +---icon1.png
| +---icon2.png
| +---icon3.png
| +---font.ttf
But it doesn't work and I don't know how to make it to.
inst/shiny
instead ofinst/www
. Maybe it helps if you change that?inst
gets copied to the higher level, soinst/www
should be correct (or did I miss a change thatwww
is now calledshiny
?)