nordcanstat_metadata_statistics_tables_names | R Documentation |
Compute statistics by entity number.
nordcanstat_metadata_statistics_tables_names(
participant_name = nordcancore::nordcan_metadata_participant_info()[["name"]]
)
loop_over_entity_numbers(x, entities, fun, arg_list)
loop_over_entity_columns(x, entities, fun, arg_list)
nordcanstat_by_entity(
entities,
arg_list,
basicepistats_fun,
loop_over = c("entity_numbers", "entity_columns")[1L]
)
participant_name |
see nordcancore::set_global_nordcan_settings |
x |
a NORDCAN cancer record dataset |
entities |
see
|
fun |
function that is applied to each entity / entity column; see Details |
arg_list |
a |
basicepistats_fun |
function from basicepistats, e.g. |
loop_over |
|
loop_over_entity_numbers
effectively loops over each entity number given in
entities
and computes the results separately for each.
loop_over_entity_columns
loops over each column defining entities in
x
. For each such column, arg_list[["by"]]
is created or modified to have
(also) the column in question, limited to only those entities supplied in
entities
.
Both of these two functions are intended to be applied internally
by the nordcanstat_
family of functions and not by the user.
fun
is called using arg_list
after the appropriate entity- or
entity column-specific modification using [base::do.call]
.
loop_over_entity_numbers
modifies an element in arg_list
named
subset
, intended to subset the cancer record dataset. If fun
does not
have an argument named subset
, the dataset x
is itself subset before
passing to fun
. This is done separately for each entity number.
loop_over_entity_columns
modifies or creates arg_list[["by"]]
before
calling fun
. x
is not subset by this function. Therefore
loop_over_entity_columns
is a more efficient but also less flexible
version of loop_over_entity_numbers
.
Either a list
or a data.table
. Initially results are collected into a
list
where each element is the set of results for an individual entity
or entity column. If every element of this list is a data.table
,
then every element is combined into one long data.table
where column
"entity"
will identify the entity. In the case of
loop_over_entity_numbers
the column "entity"
is created and in the case of
loop_over_entity_columns
each entity column is renamed to "entity"
in the entity column-specific results before combining.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.