person: Set or get the 'pregnancy.person' option for...

personR Documentation

Set or get the pregnancy.person option for pregnancy-related messages

Description

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

Usage

set_person(person)

get_person()

Arguments

person

The person who is pregnant, to determine the grammar for the output message. Can be:

  • "I", "1", "1st", "first", or numeric 1 for first person

  • "you", "2", "2nd", "second", or numeric 2 for second person

  • Any other name for third person

  • NULL: will try to use the "pregnancy.person" option. Defaults to "You" if the option is set.

Value

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

See Also

how_far() and other functions that use the person setting for message formatting

Examples

# 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)


pregnancy documentation built on Sept. 14, 2025, 5:09 p.m.