tests/testthat/_snaps/utils.md

set_option_message provides complete information about option usage

Code
  set_option_message("person")
Message
  i Functions in the pregnancy package will now use this `person` option.
  i So, for this R session, you do not need to supply a value to the `person` argument (unless you wish to override the option).
  i To make this `person` option available in all R sessions, in your ".Rprofile", set `options(pregnancy.person = ...)`
    where ... is the value of `person`.
  i You can edit your ".Rprofile" by calling `usethis::edit_r_profile()`
  i You can retrieve the `person` option with `get_person()`,
    or with `getOption('pregnancy.person')`.
Code
  set_option_message("due_date")
Message
  i Functions in the pregnancy package will now use this `due_date` option.
  i So, for this R session, you do not need to supply a value to the `due_date` argument (unless you wish to override the option).
  i To make this `due_date` option available in all R sessions, in your ".Rprofile", set `options(pregnancy.due_date = ...)`
    where ... is the value of `due_date`.
  i You can edit your ".Rprofile" by calling `usethis::edit_r_profile()`
  i You can retrieve the `due_date` option with `get_due_date()`,
    or with `getOption('pregnancy.due_date')`.
Code
  set_option_message("medications")
Message
  i Functions in the pregnancy package will now use this `medications` option.
  i So, for this R session, you do not need to supply a value to the `medications` argument (unless you wish to override the option).
  i To make this `medications` option available in all R sessions, in your ".Rprofile", set `options(pregnancy.medications = ...)`
    where ... is the value of `medications`.
  i You can edit your ".Rprofile" by calling `usethis::edit_r_profile()`
  i You can retrieve the `medications` option with `get_medications()`,
    or with `getOption('pregnancy.medications')`.

set_option_null_message works correctly for person option

Code
  set_option_null_message("person")
Message
  v pregnancy.person option set to NULL.
  i The `person` argument will now default to "You".

set_option_null_message works correctly for other options

Code
  set_option_null_message("due_date")
Message
  v pregnancy.due_date option set to NULL.
  i You will need to explicitly pass a value to the `due_date` argument
    in functions that use it, or reset the option with `set_due_date()`.
Code
  set_option_null_message("medications")
Message
  v pregnancy.medications option set to NULL.
  i You will need to explicitly pass a value to the `medications` argument
    in functions that use it, or reset the option with `set_medications()`.

set_option_null_message works correctly for unknown option

Code
  set_option_null_message("unknown_option")
Message
  v pregnancy.unknown_option option set to NULL.
  i You will need to explicitly pass a value to the `unknown_option` argument
    in functions that use it, or reset the option with `set_unknown_option()`.

null_option displays warning for any option

Code
  null_option("person")
Message
  ! You do not have `pregnancy.person` set as an option.
  i The `person` argument defaults to "You".
Code
  null_option("due_date")
Message
  ! You do not have `pregnancy.due_date` set as an option.
  i You can set it with `set_due_date()`.
  i You can also pass a value directly to the `due_date` argument where required.
Code
  null_option("medications")
Message
  ! You do not have `pregnancy.medications` set as an option.
  i You can set it with `set_medications()`.
  i You can also pass a value directly to the `medications` argument where required.


Try the pregnancy package in your browser

Any scripts or data that you put into this service are public.

pregnancy documentation built on Nov. 19, 2025, 5:07 p.m.