tool_specific_metadata: Tool-specific Metadata

tool_specific_metadataR Documentation

Tool-specific Metadata

Description

Tools to access tool-specific metadata. You will almost certainly not need to use any of these functions.

Usage

tool_menu_name(tool.name)

tool_menu_item_name(tool.name)

tool_names()

tool_colnameset_name_to_tool_name(colnameset.name)

tool_colnameset_names()

tool_colnameset(colnameset.name)

tool_colnameset_example_dataset(colnameset.name, n.rows = 10L)

tool_column_classes(col.nms)

tool_column_fwf_widths(col.nms)

tool_column_explanation(col.nms)

Arguments

tool.name

⁠[character]⁠ (mandatory, no default)

name of tool to run; see output of tool_clean_names() for options

colnameset.name

one of the items returned by tool_colnameset_names

n.rows

⁠[integer]⁠ (default 10L)

How many times should the example row (only one is defined) be repeated? Each resulting row will have its own subject_id and record_id.

col.nms

⁠[character]⁠ (no default)

Names of columns.

Functions

⁠[iarccrgtools::tool_menu_name]⁠ gives the name of the menu in IARC CRG Tools for the given tool.name.

⁠[iarccrgtools::tool_menu_item_name]⁠ gives the name of the item in the appropriate menu in IARC CRG Tools for the given tool.name.

⁠[iarccrgtools::tool_names]⁠ gives the names of all tools.

⁠[iarccrgtools::tool_colnameset_name_to_tool_name]⁠ gets the name of the tool from the column name set name.

⁠[iarccrgtools::tool_colnameset_names]⁠ returns all names of column name sets.

⁠[iarccrgtools::tool_colnameset]⁠ returns all column names for the given column name set name.

⁠[iarccrgtools::tool_example_dataset]⁠ returns a data.table, a fake example of what the data should look like for a given colnameset.name.

⁠[iarccrgtools::tool_column_classes]⁠ returns the appropriate class for each supplied column name.

⁠[iarccrgtools::tool_column_fwf_widths]⁠ returns the column width for each given column name (width in the text file which IARC CRG Tools uses).

⁠[iarccrgtools::tool_column_explanation]⁠ gives as short explanation for each given column name.

Examples


# iarccrgtools::tool_menu_name
stopifnot(
  iarccrgtools::tool_menu_name("check") == "Tools"
)

# iarccrgtools::tool_menu_item_name
stopifnot(
  iarccrgtools::tool_menu_item_name("check") == "IARC/IACR Check"
)

# iarccrgtools::tool_names
stopifnot(
  c("check", "icdo3_to_icd10") %in% iarccrgtools::tool_names()
)

# iarccrgtools::tool_colnameset_name_to_tool_name
stopifnot(
  iarccrgtools::tool_colnameset_name_to_tool_name("mandatory_check") ==
    "check"
)

# iarccrgtools::tool_colnameset_names
stopifnot(
  "all_check" %in% iarccrgtools::tool_colnameset_names()
)

# iarccrgtools::tool_colnameset
stopifnot(
  "sex" %in% iarccrgtools::tool_colnameset("all_check")
)

# iarccrgtools::tool_colnameset_example_dataset
ac <- iarccrgtools::tool_colnameset_example_dataset("all_check", 20L)
stopifnot(
  "sex" %in% names(ac),
  !duplicated(ac[["subject_id"]])
)

# iarccrgtools::tool_column_classes
stopifnot(
  iarccrgtools::tool_column_classes("sex") == "integer"
)

# iarccrgtools::tool_column_fwf_widths
stopifnot(
  iarccrgtools::tool_column_fwf_widths("sex") == 1
)

# iarccrgtools::tool_column_explanation
stopifnot(
  iarccrgtools::tool_column_explanation("dg_date") == "Date of diagnosis"
)

WetRobot/iarccrgtools documentation built on Feb. 1, 2024, 6:33 a.m.