fcds_vars: Select Common FCDS Variable Groups

Description Usage Arguments Value Examples

View source: R/fcds.R

Description

The FCDS data set includes a number of thematically-groups variables. This function helps select those groups by returning variable names.

Usage

1
fcds_vars(..., .data = NULL)

Arguments

...

Variable group names, as characters. Partial matching is allowed and the matching is not case-sensitive. Possible variable groups include "id", "demographics", "cancer", "icdo3", "population", "seer", "tobacco".

A group may be input multiple times, but only the first appearance will be used. The final variable list is ordered by the requested group, unless .data is supplied.

.data

If '.data“ is included, then the variables in the input data are subset to only those appearing in the selected groups, in the order they appear in the original data.

Value

A character vector of column names, or, if .data is provided, a data frame subset to include columns matching the requested groups.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
fcds_vars("demo")
fcds_vars("demographics")

fcds_vars("id", "demo", "pop")

fcds_vars("seer", "tobacco", "seer")

dplyr::tibble(
  patient_id = 1:5,
  year = 2000,
  county_name = "Pinellas",
  age_group = c("65 - 69", "10 - 14", "25 - 29", "70 - 74", "40 - 44"),
  cancer_status = c("Evidence of tumor", "Unknown", "No evidence of tumor",
                    "No evidence of tumor", "No evidence of tumor")
) %>%
  fcds_vars(.data = ., "id", "pop", "demo")

GerkeLab/fcds documentation built on July 30, 2020, 7:04 p.m.