use_event: Create an event.

Description Usage Arguments Examples

View source: R/usethis.R

Description

This function creates an event script from the provided event template inside a module along with a testtthat test script.

Usage

1
use_event(name, module, with_comments)

Arguments

name

Name of the event.

module

Name of the module folder to add a event file to. The function looks for a folder inside the modules folder at the root folder of the active R project. If the module folder is not found or has not been created this will return an error.

with_comments

a logical value. If TRUE the generated event script will contain comments about what each component inside the script does and some recommendations for the user to follow when authoring an event. For advance users, you may not need this hence you may specify FALSE. If missing, it will be prompted in the console for you to decide.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# Note: running this will create a folder called "modules" and a sub-folder
#       to your working directory within the folder called "demography"
use_module(name = "demography")

# create an event called 'birth' inside the 'demography' module.
use_event(name = "birth", module = "demography")

## End(Not run)

dymium-org/dymiumCore documentation built on July 18, 2021, 5:10 p.m.