Skip to contents

Retrieves source-related fields (for example, SOURCE) from metadata for a specified program name or TFL number.

Usage

get_source(df, tnumber = NULL, pname = NULL, oid = NULL)

Arguments

df

A data frame containing TFL metadata.

tnumber

An optional character string specifying the TFL number stored in TTL1, such as "Table 14.1.1".

pname

An optional character string specifying the program name stored in PGMNAME.

Exactly one of tnumber or pname must be supplied.

oid

An optional character string specifying the object ID stored in OID. Use this when multiple rows match the program name.

Value

A data frame of the non-missing source fields.

See also

read_tfile() to read metadata from Excel or CSV;

get_title(), get_footnote(), get_pop(), get_byline(), get_pgmname(), get_ulheader(), get_urheader(), and get_bookm() for retrieving individual annotation fields;

tflmetaR() for a single-call alternative.

Examples

meta <- data.frame(
  PGMNAME = c("t_dm", "t_ae"),
  TTL1 = c("Table 14.1.1", "Table 14.3.1"),
  SOURCE = c("ADSL", "ADAE"),
  FOOT1 = c("ITT Population", "Safety Population")
)

get_source(meta, pname = "t_dm")
#>   SOURCE
#> 1   ADSL
get_source(meta, tnumber = "Table 14.3.1")
#>   SOURCE
#> 2   ADAE