There are two mechanisms for working with options for xportr. One is the
options() function, which is part of base R, and the other is the
xportr_options() function, which is in the xportr package. The reason for
these two mechanisms is has to do with legacy code and scoping.
The options() function sets options globally, for the duration of the R
process. The getOption() function retrieves the value of an option. All
xportr related options of this type are prefixed with "xportr.".
xportr_options(...)Options to set, with the form name = value or a character vector of option names.
defaults to "dataset"
defaults to "label"
defaults to "dataset"
defaults to "variable"
defaults to "type"
defaults to "label"
defaults to "length"
defaults to "order"
defaults to "format"
defaults to "none"
defaults to "none"
defaults to "none"
defaults to "label"
defaults to "character"
defaults to c("character", "char", "text", "date", "posixct", "posixt", "datetime", "time", "partialdate", "partialtime", "partialdatetime", "incompletedatetime", "durationdatetime", "intervaldatetime")
defaults to c("integer", "numeric", "num", "float")
defaults to c("integer", "float", "numeric", "posixct", "posixt", "time", "date")
Alternative to the options(), the xportr_options() function can be used to set the options.
The xportr_options() function also returns the current options when a character vector of
the options keys are passed into it. If nothing is passed into it, it returns the state of all xportr options.
xportr_options("xportr.df_label")
xportr_options(xportr.df_label = "data_label", xportr.label = "custom_label")
xportr_options(c("xportr.label", "xportr.df_label"))
xportr_options()
Run the code above in your browser using DataLab