get_cites: Get citations for CSPP variables

View source: R/get_cites.R

get_citesR Documentation

Get citations for CSPP variables

Description

get_cites retrieves citations for variables in the CSPP dataset. Users can print the citations to the console, save them as dataframes, and write them to multiple file types (csv, txt). Citations can be written in one of multiple formats (plaintext, bib). Supply variable names that need to be cited with the var_names argument. The function prints user-supplied variable names that do not match any in the CSPP dataset by default (print_nomatch). The function also returns the citation for the cspp package and the CSPP dataset as a whole. We request you cite both if you use this package for your research.

Usage

get_cites(
  var_names,
  write_out = FALSE,
  file_path = NULL,
  format = "bib",
  print_cites = FALSE,
  print_nomatch = TRUE
)

Arguments

var_names

Default is NULL. Takes a character string. Should be one or more variables from the CSPP dataset. A citation for each variable is returned.

write_out

Default is FALSE. Takes a logical. If FALSE the function does not write the citations out to a file.

file_path

Default is NULL. Takes a character string. If write_out = T then the file will be saved to this filepath.

format

Default is bib. Takes a character string. If write_out = T then the resulting file will be in this format. User must supply "bib", "csv", or "txt".

print_cites

Default is FALSE. Takes a logical value. If TRUE then the function prints the citations to the console.

print_nomatch

Default is TRUE. Takes a logical value. If FALSE then the function does not print variables the user supplied that had no match in CSPP.

See Also

get_cspp_data, get_var_info, generate_map

Examples


get_cites("poptotal")

## Not run: 
get_cites(var_names = "poptotal",
          write_out = TRUE,
          file_path = "~/path/to/file.csv",
          format = "csv")

## End(Not run)

cspp documentation built on Dec. 28, 2022, 2:46 a.m.