Comments (5)
Glad you like shinyStan! And thanks for bringing up this question. I haven't yet tried to deploy shinyStan to shinyapps, so I'm not sure if it's possible, but I will look into this.
A few things that will be helpful for me to know:
- Which version of the 'maps' package do you have installed?
- Which method did you use to install and reinstall shinyStan (e.g. the source_url method here, downloading the source code, etc.)?
More generally, there might be a few things that make it difficult to get shinyStan working on shinyapps.io, but I didn't think threejs would be the problem. threejs isn't on CRAN, but last time I checked shinyapps now works with packages from github also, so I don't know why threejs seems to be causing an error. The biggest problem I can think of (and it doesn't have anything to do with threejs) is that shinyStan doesn't work like a typical Shiny app in that the data it needs (i.e. your shinystan object, or stanfit object) isn't uploaded after the app is already running but rather passed as an argument to the launch_shinystan function. So it needs to access an object in your global environment. I would think this wouldn't be compatible with shinyapps.io.
That said, you could probably get around this by
- renaming your shinystan object
shinystan_object
and saving it as a .RData file (you can save the .RData file with any name you want as long as the actual shinystan object you're saving is namedshinystan_object
) - putting the .RData file in the inst/shinyStan directory (i.e. the same directory as server.R and ui.R)
- also in the same directory put a file called global.R that just contains the line
load("shinystan_object.RData")
.
Then you could run shinyStan (but just with that shinystan object) like a normal shiny app (i.e. without having to use the launch_shinystan function), which might make it possible to get it working with shinyapps.io.
Anyway, I will look into whether this is actually possible and also what's going on with the threejs error. If it does end up being feasible I should probably make a tutorial for doing it.
from shinystan.
Ok, good news (mostly). I was able to get an example of shinyStan up on shinyapps.io here. I did have to make some changes along the lines of steps 1), 2) and 3) in my comment above and I also had to remove the parts of shinyStan that reference threejs (at least until I can figure out how to sort out that problem). There were a few other little things too.
I'll hopefully have a chance this weekend or next week to make this process easier and write up a tutorial for doing this so more people can do it, but for the time being if you want to get your app up and running here's what you can do:
- Take the shinystan object for the model you want to use and rename it (or rename a copy of it)
shinystan_object
and save it somewhere asshinystan_object.RData
. So,
shinystan_object <- your_shinystan_object
save(shinystan_object, file = "shinystan_object.RData")
-
Download shinyStan_for_shinyapps.zip, which I just uploaded here and unzip it.
-
Put your
shinystan_object.RData
file from step 1) in the shinyStan_for_shinyapps folder. -
Try running shinyapps::deployApp(appDir = "shinyStan_for_shinyapps", appName = "X") and just replace X with whatever you want to call your app. You might get a warning like
Paths should be to files within the project directory
, but go ahead and proceed with deployment. -
Let me know if it works!
from shinystan.
I did the three steps as detailed in your second reply, and it works like a charm. Thanks very much! Maybe this workaround could be a function in the shinystan package?
from shinystan.
Great! Glad it works.
And yeah, we're working on making this easy to do. It might be in the form of a function or maybe a separate little package that's optimized for this purpose, but it will definitely become part of the intended functionality in one of the next releases.
Thanks for bringing this to my attention!
from shinystan.
I'm going to close this issue now and open a new one about including this in next release
from shinystan.
Related Issues (20)
- use posterior package for handling draws HOT 2
- Check for R version 4.0 HOT 1
- selectizeInput for estimates statistics instead of checkboxGroupInput HOT 1
- Default for "max_treedepth"/"max_td" (11) incorrect? HOT 4
- Add support for CmdStanR objects HOT 3
- diagnostics page doesn't load if `stan_used=FALSE`? HOT 1
- Suppress messages when packages are loaded
- how to raise limit above 1000 parameters? HOT 3
- Shiny stan do not work in ubuntu (tested in ubuntu 20.04 and 16.04 both LTS versions)
- variables missing from drop-down HOT 5
- Problem with LaTeX table: ErrorL subscription out of bounds HOT 6
- Latex for graphs like stan_ac, stan_dens, and others HOT 3
- Rocker script?
- Problem with missing themes HOT 13
- Flickering when selecting parameters on page "ESTIMATE"
- gtools is orphaned - Consider a replacement?
- Issue when launching shinystan demo
- launch_shinystan error message
- toggle view for `exp(param)' ?
- Running ‘testthat.R’/opt/local/Library/Frameworks/R.framework/Resources/bin/BATCH: line 60: 98584 Bus error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinystan.