8.3 Setting things up with dev/01_start.R
dev/01_start.R
is the first file that you need to populate and run.
8.3.1 Fill the DESCRIPTION
and set options
- Within the
dev/01_start.R
file, you need to populate some pertinent information related to your project.
NOTE: This is an automated system. Only edit and run this file first as the remaining steps will be completed in sequence for proper packaging process.
::fill_desc(
golem# The Name of the package containing the App
pkg_name = "ipsumapp",
# The Title of the package containing the App
pkg_title = "PKG_TITLE",
# The Description of the package containing the App
pkg_description = "PKG_DESC.",
# Your First Name
author_first_name = "AUTHOR_FIRST",
# Your Last Name
author_last_name = "AUTHOR_LAST",
# Your Email
author_email = "AUTHOR@MAIL.COM",
# The URL of the GitHub Repo (optional)
repo_url = NULL
)
- Run
golem::set_golem_options()
function.
NOTE: This adds your information to the
golem-config.yml
file and sets thehere
package root sentinel. This is important ashere
manages the/root
of your project. If if you change your working directory in the project, you will still be able to create modules and CSS files in their correct folders.
8.3.2 Set common files
If you’d like to set your: Liscense, README, Code of Conduct, lifecycle badge, and NEWS,you can do so here.
# You can set another license here
::use_mit_license( name = "Golem User" )
usethis# Add a README, Code of Conduct, lifecycle badge and NEWS.md
# file to your application
::use_readme_rmd( open = FALSE )
usethis::use_code_of_conduct()
usethis::use_lifecycle_badge( "Experimental" )
usethis::use_news_md( open = FALSE ) usethis
Set up your version control account
::use_git() usethis
8.3.3 Use recommended elements
golem::use_recommended_tests()
and golem::use_recommended_deps()
sets a default testing infrastructure and adds dependencies to the application.
8.3.4 Add utility functions
The next two code snippets (steps) will add various functions which can be used along the process of building your app.
# These files will create R/golem_utils_ui.R
# and R/golem_utils_server.R
::use_utils_ui()
golem::use_utils_server() golem
For example, using these utilities list_to_li()
is a function to turn R lists into an HTML list. Another example is with_red_star()
which puts a red astrix next to a mandatory input.
8.3.5 Changing the favicon
You have an option of changing icons associated with your app. By default is the golem hex. Should you provide your own favicon library, you can use this code snippet:
::use_favicon( path = "path/to/favicon") golem
Once complete, you can move to the second step, dev/02_dev.R