person | R Documentation |
pregnancy.person
option for pregnancy-related messagesFunctions to get and set the default person used in messages throughout the package.
This affects the grammar and pronouns used in various function outputs. Settings
persist for the current R session only, unless added to .Rprofile. set_person()
sets the "pregnancy.person" option and get_person()
retrieves it.
set_person(person)
get_person()
person |
The person who is pregnant, to determine the grammar for the output message. Can be:
|
Both functions invisibly return the current person setting:
get_person() returns the current setting (a character string) or NULL if not set
set_person() returns the person value that was set
how_far()
and other functions that use the person setting for message formatting
# Store original setting (without messages)
original_person <- getOption("pregnancy.person")
# Check current setting
get_person()
# Set to first person (using string)
set_person("I")
get_person()
# Set to second person (using number)
set_person(2)
get_person()
# Set to a specific name
set_person("Sarah")
get_person()
# Restore original setting (without messages)
options(pregnancy.person = original_person)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.