camr_pull_codebook_entry: Extract Codebook Entry for a Variable

View source: R/R07-Codebook.R

camr_pull_codebook_entryR Documentation

Extract Codebook Entry for a Variable

Description

Function to extract a codebook entry for a specified variable, or indicate all variables in a data frame that have codebook entries.

Usage

camr_pull_codebook_entry(x = NULL, variable = "")

camr_puce(...)

Arguments

x

Either (a) a data frame or (b) a column in a data frame.

variable

If x is a data frame, the column in the data frame from which the codebook entry should be extracted.

Value

Either (a) the data frame of additional class codebook_entry for the specified variable, or (b) a logical vector equal to TRUE for columns with codebook entries.

Author(s)

Kevin Potter

Examples

data( "example_CAM_data_set" )
dtf <- example_CAM_data_set[,1:2]

# Add codebook entry to data frame
dtf <- dtf |>
  camr_add_codebook_entry(
    IDS.INT.Screening,
    description = "Identifier assigned at screening session"
)
# Identify columns with and without codebook entries
camr_pull_codebook_entry( dtf )

# Extract codebook entry
dtf |> camr_pull_codebook_entry( IDS.INT.Screening )
# Alternative approach
camr_pull_codebook_entry( dtf$IDS.INT.Screening )


rettopnivek/camrprojects documentation built on March 26, 2024, 9:17 a.m.