make_specs_app: make_specs_app

Description Usage Arguments Value Author(s) Examples

View source: R/make_specs_app.r

Description

Makes a portable version of the interactive visualization from plot_specs_shiny() that can be uploaded to shinyapps.io (or similar?). Note that this function takes the same arguments as plot_specs_shiny(). It is advised to make sure your visualization works properly using that function, before making it portable with this function. An additional argument for the name of your output app directory is also required; this name will become the last part of your URL if you upload to shinyapps.io, so use care when choosing. Note that this function automatically includes a portable version of the specificity.shiny R package inside your app, so you don't need to deal with installing it on the server; although the server will need specificity.shiny's dependencies installed (shinyapps.io already does, you don't need to do anything).

Usage

1
make_specs_app(sl, fd = NULL, fd_id_col = 1, app_fp = "mySpecApp")

Arguments

sl

specs_list. A named list of outputs from phy_or_env_spec. See examples.

fd

data.frame. Optional feature data - a data.frame object with one row per feature, including some column with feature IDs that includes feature IDs in sl as rownames. If NULL, no feature data will be used (default:NULL).

fd_id_col

integer or string. Either the column number of fd containing feature IDs (see above), or the column name of that column (default: 1).

app_fp

filepath to a folder where the app should be stored. Only forward slashes ("/") are supported! The folder should not exist yet, and this function will throw an error if it does exist. This is to avoid overwriting. As mentioned above, the name of this folder will become the last part of your URL if you upload to shinyapps.io. For example, if you set app_fp="~/Desktop/mySpecApp", this function will first check if directory "mySpecApp" exists on your desktop. Then, if it doesn't, it will create that directory and put all the necessary files inside of it (default:"mySpecApp").

Value

Returns nothing, but creates a folder containing a shiny app.

Author(s)

John L. Darcy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# attach(antarctica)
# # test that it works:
# plot_specs_shiny(antarctica_specs_list, antarctica_taxonomy, 1)
# # make the app:
# make_specs_app(antarctica_specs_list, antarctica_taxonomy, 1, "antarctica_specs_shiny_app")
# # upload to shinyapps.io (will automatically open in browser when done)
# # package "rsconnect" is required for this next step, and requires an account with
# # shinyapps.io and configuration of the rsconnect package; see their VERY easy guide
# # here: https://docs.rstudio.com/shinyapps.io/getting-started.html
# # Just make an account and configure rsconnect, no need to do anything after that.
# rsconnect::deployApp("antarctica_specs_shiny_app")

darcyj/specificity.shiny documentation built on Dec. 19, 2021, 8:11 p.m.