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

  1. 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.

golem::fill_desc(
  # 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 
)   
  1. Run golem::set_golem_options() function.

NOTE: This adds your information to the golem-config.yml file and sets the here package root sentinel. This is important as here 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
usethis::use_mit_license( name = "Golem User" )  
# Add a README, Code of Conduct, lifecycle badge and NEWS.md 
# file to your application
usethis::use_readme_rmd( open = FALSE )
usethis::use_code_of_conduct()
usethis::use_lifecycle_badge( "Experimental" )
usethis::use_news_md( open = FALSE )

Set up your version control account

usethis::use_git()

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
golem::use_utils_ui()
golem::use_utils_server()

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:

golem::use_favicon( path = "path/to/favicon")

Once complete, you can move to the second step, dev/02_dev.R