Function to set global options for fonctionr. The arguments defined in the options are only active if the user has not manually specified a value for those arguments within the various functions. Arguments may be shared by multiple functions (if they have the same name) or specific to certain functions.
Usage
fonctionr_options(
na.rm.group = NULL,
na.rm.facet = NULL,
na.prop = NULL,
na.vars = NULL,
na.rm.var = NULL,
probs = NULL,
total = NULL,
prop_method = NULL,
quantiles = NULL,
moustache_probs = NULL,
bw = NULL,
resolution = NULL,
height = NULL,
limits = NULL,
reorder = NULL,
position = NULL,
show_ci = NULL,
show_mid_point = NULL,
show_mid_line = NULL,
show_ci_errorbar = NULL,
show_ci_lines = NULL,
show_ci_area = NULL,
show_quant_lines = NULL,
show_moustache = NULL,
show_n = NULL,
show_value = NULL,
show_labs = NULL,
total_name = NULL,
scale = NULL,
digits = NULL,
unit = NULL,
dec = NULL,
col = NULL,
pal = NULL,
direction = NULL,
desaturate = NULL,
lighten = NULL,
darken = NULL,
col_density = NULL,
col_moustache = NULL,
col_border = NULL,
alpha = NULL,
dodge = NULL,
font = NULL,
wrap_width_y = NULL,
wrap_width_leg = NULL,
legend_ncol = NULL,
title = NULL,
subtitle = NULL,
xlab = NULL,
ylab = NULL,
legend_lab = NULL,
caption = NULL,
lang = NULL,
theme = NULL,
coef_font = NULL,
parallel = NULL,
erase_all = FALSE
)Arguments
- na.rm.group
na.rm.groupargument.- na.rm.facet
na.rm.facetargument.- na.prop
na.propargument.- na.vars
na.varsargument.- na.rm.var
na.rm.varargument.- probs
probsargument.- total
totalargument.- prop_method
prop_methodargument.- quantiles
quantilesargument.- moustache_probs
moustache_probsargument.- bw
bwargument.- resolution
resolutionargument.- height
heightargument.- limits
limitsargument.- reorder
reorderargument.- position
positionargument.- show_ci
show_ciargument.- show_mid_point
show_mid_pointargument.- show_mid_line
show_mid_lineargument.- show_ci_errorbar
show_ci_errorbarargument.- show_ci_lines
show_ci_linesargument.- show_ci_area
show_ci_areaargument.- show_quant_lines
show_quant_linesargument.- show_moustache
show_moustacheargument.- show_n
show_nargument.- show_value
show_valueargument.- show_labs
show_labsargument.- total_name
total_nameargument.- scale
scaleargument.- digits
digitsargument.- unit
unitargument.- dec
decargument.- col
colargument.- pal
palargument.- direction
directionargument.- desaturate
desaturateargument.- lighten
lightenargument.- darken
darkenargument.- col_density
col_densityargument.- col_moustache
col_moustacheargument.- col_border
col_borderargument.- alpha
alphaargument.- dodge
dodgeargument.- font
fontargument.- wrap_width_y
wrap_width_yargument.- wrap_width_leg
wrap_width_legargument.- legend_ncol
legend_ncolargument.- title
titleargument.- subtitle
subtitleargument.- xlab
xlabargument.- ylab
ylabargument.- legend_lab
legend_labargument.- caption
captionargument.- lang
langargument.- theme
themeargument.- coef_font
coef_fontargument.- parallel
parallelargument.- erase_all
TRUEerases all the options. Default isFALSE.
Examples
# We set global settings
fonctionr_options(coef_font = 1.5, col = "magenta", caption = "Beautiful caption")
#> $fonctionr.options
#> $fonctionr.options$col
#> [1] "magenta"
#>
#> $fonctionr.options$caption
#> [1] "Beautiful caption"
#>
#> $fonctionr.options$coef_font
#> [1] 1.5
#>
#>
# Loading of data
data(eusilc, package = "laeken")
# Recoding eusilc$pl030 into eusilc$pl030_rec
eusilc$pl030_rec <- NA
eusilc$pl030_rec[eusilc$pl030 == "1"] <- "Working full time"
eusilc$pl030_rec[eusilc$pl030 == "2"] <- "Working part time"
eusilc$pl030_rec[eusilc$pl030 == "3"] <- "Unemployed"
eusilc$pl030_rec[eusilc$pl030 == "4"] <- "Student"
eusilc$pl030_rec[eusilc$pl030 == "5"] <- "Retired"
eusilc$pl030_rec[eusilc$pl030 == "6"] <- "Permanently disabled"
eusilc$pl030_rec[eusilc$pl030 == "7"] <- "Fulfilling domestic tasks"
# Computation, taking sample design into account
eusilc_prop <- prop_group(
eusilc,
group = pl030_rec,
prop_exp = py090n > 0,
weight = rb050,
title = "% of ind. receiving unemployment benefits in their hh",
subtitle = "Example with austrian SILC data from 'laeken' package"
)
#> Warning: NAs introduced by coercion
#> Warning: NAs introduced by coercion
#> Warning: Active parameters in function r_options(): col, caption, coef_font
#> Input: data.frame
#> Sampling design -> ids: `1`, weights: rb050
#> Variable(s) detected in prop_exp: py090n
#> Numbers of observation(s) removed by each filter (one after the other):
#> 2720 observation(s) removed due to missing group
#> 0 observation(s) removed due to missing value(s) for the variable(s) in prop_exp
# Results in graph form
eusilc_prop$graph
#> Warning: Removed 7 rows containing missing values or values outside the scale range
#> (`geom_text()`).
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_text()`).
# We set back settings to default
fonctionr_options(erase_all = TRUE)
#> No fonctionr option active