Splits for cutting by values of a numeric variable
Create static cut or static cumulative cut split
Usage
make_static_cut_split(
var,
split_label,
cuts,
cutlabels = NULL,
cfun = NULL,
cformat = NULL,
cna_str = NA_character_,
split_format = NULL,
split_na_str = NA_character_,
split_name = var,
child_labels = c("default", "visible", "hidden"),
extra_args = list(),
indent_mod = 0L,
cindent_mod = 0L,
cvar = "",
cextra_args = list(),
label_pos = "visible",
cumulative = FALSE,
page_prefix = NA_character_,
section_div = NA_character_,
show_colcounts = FALSE,
colcount_format = NULL
)
VarDynCutSplit(
var,
split_label,
cutfun,
cutlabelfun = function(x) NULL,
cfun = NULL,
cformat = NULL,
cna_str = NA_character_,
split_format = NULL,
split_na_str = NA_character_,
split_name = var,
child_labels = c("default", "visible", "hidden"),
extra_args = list(),
cumulative = FALSE,
indent_mod = 0L,
cindent_mod = 0L,
cvar = "",
cextra_args = list(),
label_pos = "visible",
page_prefix = NA_character_,
section_div = NA_character_,
show_colcounts = FALSE,
colcount_format = NULL
)
Arguments
- var
(
string
)
variable name.- split_label
(
string
)
label to be associated with the table generated by the split. Not to be confused with labels assigned to each child (which are based on the data and type of split during tabulation).- cuts
(
numeric
)
cuts to use.- cutlabels
(
character
orNULL
)
labels for the cuts.- cfun
(
list
,function
, orNULL
)
tabulation function(s) for creating content rows. Must acceptx
ordf
as first parameter. Must acceptlabelstr
as the second argument. Can optionally accept all optional arguments accepted by analysis functions. Seeanalyze()
.- cformat
(
string
,function
, orlist
)
format for content rows.- cna_str
(
character
)
NA string for use withcformat
for content table.- split_format
(
string
,function
, orlist
)
default format associated with the split being created.- split_na_str
(
character
)
NA string vector for use withsplit_format
.- split_name
(
string
)
name associated with the split (for pathing, etc.).- child_labels
(
string
)
the display behavior for the labels (i.e. label rows) of the children of this split. Accepts"default"
,"visible"
, and"hidden"
. Defaults to"default"
which flags the label row as visible only if the child has 0 content rows.- extra_args
(
list
)
extra arguments to be passed to the tabulation function. Element position in the list corresponds to the children of this split. Named elements in the child-specific lists are ignored if they do not match a formal argument of the tabulation function.- indent_mod
(
numeric
)
modifier for the default indent position for the structure created by this function (subtable, content table, or row) and all of that structure's children. Defaults to 0, which corresponds to the unmodified default behavior.- cindent_mod
(
numeric(1)
)
the indent modifier for the content tables generated by this split.- cvar
(
string
)
the variable, if any, that the content function should accept. Defaults toNA
.- cextra_args
(
list
)
extra arguments to be passed to the content function when tabulating row group summaries.- label_pos
(
string
)
location where the variable label should be displayed. Accepts"hidden"
(default for non-analyze row splits),"visible"
,"topleft"
, and"default"
(for analyze splits only). Foranalyze
calls,"default"
indicates that the variable should be visible if and only if multiple variables are analyzed at the same level of nesting.- cumulative
(
flag
)
whether the cuts should be treated as cumulative. Defaults toFALSE
.- page_prefix
(
string
)
prefix to be appended with the split value when forcing pagination between the children of a split/table.- section_div
(
string
)
string which should be repeated as a section divider after each group defined by this split instruction, orNA_character_
(the default) for no section divider.- show_colcounts
(
logical(1)
)
should column counts be displayed at the level facets created by this split. Defaults toFALSE
.- colcount_format
(
character(1)
)
ifshow_colcounts
isTRUE
, the format which should be used to display column counts for facets generated by this split. Defaults to"(N=xx)"
.- cutfun
(
function
)
function which accepts the full vector ofvar
values and returns cut points to be used (viacut
) when splitting data during tabulation.- cutlabelfun
(
function
)
function which returns either labels for the cuts orNULL
when passed the return value ofcutfun
.