
Automate and codify Appsilon practices to pass on knowledge in the form of code.Unify applications’ architecture by providing sensible defaults.Save time and avoid repetitive tasks by including best practices we value at the start of a project.Rhino’s core benefits to our R/Shiny development process: The origins of the Rhino R package start from an internal need at Appsilon to avoid repetitive tasks, unify architecture, and codify our practices. Rhino is an opinionated framework focusing on best practices and development tools for R Shiny developers. Similar options to the Rhino R package🟰.At Appsilon, we have something different in our toolbox we use Rhino. But this simplicity also makes it difficult to build production-grade Shiny apps. It involves a single app.R with a ui.R and server.R. If you accidentially did both, remove the global version using rm(concat_two_vec).The standard procedure to create a Shiny app is straightforward. Do not use both methods mentioned above in the same time, this will create concat_two_vec() in the global space and mask myfirstRpackage::concat_two_vec(). Calling source("R/concat_two_vec.R") in package root directory will install it in the global workplace, whereas load_all() installs this package in development mode (also installs unexported internal ones, read more in devtools). Install package functions in dev mode and do some testsĪfter you’ve written a function and would like to test if it works, there are two ways to make a function available. Use git to commit small and meaningful changes, you can use git window built in Rstudio to do that.

Each time you add a new function to R/, you will need to run document() again. The documentation will be saved in man/ and can be looked up by ?function_name.In addition, it adds function names in R/ to NAMESPACE. There are many more types of tags one can use, see roxygen quick reference.Īfter docstring of the function of interest is generated, run document() to generate documentation for the functions you have in R/.


Most functions’ docstring have (follows by the description of input, one input variable per line), (follow by the description of what the function returns), (follows by an example usage of the function). To do this, we would need to write docstrings in a specific way for each function before defining it. Here we want to use roxygen2 package to generate markdown page for each function, the markdown files will be saved in man and can be accessed by ?function_name. Use_test() # create unit test template, you can add some test cases My_func_with_dplyr <- function(df, col_name) Use_r("my_func_with_ dplyr") #creates 'R/my_func_with_dplyr.R' Use_package("dplyr") #adds "dplyr" to Imports field in DESCRIPTION
