This package was developed to simplify shiny app development at BCStats.
It uses bcgovr::create_bcgov_project()
to set up an RProject with all
the files necessary to comply with bcgov standards and then also adds in
the files needed for a basic BCStats shiny app.
Using this package for initializing shiny apps will also ensure consistency across BCStats’ apps
create_bcstats_app()
Create a new shiny web application project with
folders and files to meet both the bcgov standards (utilizing
bcgovr) and the BCStats standards for
shiny apps.
bcsHeaderUI()
and bcsHeaderServer()
Add the standard BCStats header
to your app. An appname is required in bcsHeaderUI()
for the title to
be included in the header. To exclude the drop down list of links to
other BCStats apps (kept up to date in
bcstatslinks), use
bcsHeaderServer(links = FALSE)
the default is TRUE
.
bcsFooterUI()
and bcsFooterServer
Add the standard BCStats footer to
your app.
Note that create_bcstats_app()
generates a basic app.R file with these
modules already included.
This package relies on the bcgovr and bcstatslinks packages, so they need to be installed first. To install packages from github, use the remotes package
## install dependencies
install.packages("remotes")
remotes::install_github("bcgov/bcgovr")
remotes::install_github("bcgov/bcstatslinks")
## install package
remotes::install_github("bcgov/bcsapps")
## load package
library(bcsapps)
Use this package in combination with the bcgovr package.
create_bcstats_app()
)create_bcstats_app(coc_email = "<insert email address to be used in the code of conduct file>")
bcgovr::use_bcgov_git(coc_email = "<insert email address to be used in the code of conduct file>")
to initialize git version controlbcgovr::use_bcgov_github(coc_email = "<insert email address to be used in the code of conduct file>")
to open a bcgov GitHub repositoryNote, to avoid typing in your email several times it is recommended to
add an option to your .Rprofile
. You can easily edit your .Rprofile
with usethis::edit_r_profile()
and then add in the line
options(“bcgovr.coc.email” = “your.email@gov.bc.ca”. This will edit
(and create if necessary) the .Rprofile
file under
C:/Users/.Rprofile
on C:/Program
Files/R/ they will continue to be used at startup as well.
Once your github project is initialized, add in the citz and bcstats topics by clicking the settings “gear” icon next to About on the right panel on GitHub.
To change the name of your “master” branch to “main”:
Experimental
To report bugs/issues/feature requests, please file an issue.
If you would like to contribute to the package, please see our CONTRIBUTING guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Copyright 2021 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
This project was created using the bcgovr package.