Explore the files associated with a GESIS Search record. The output of this
function may guide you in selecting a file to download using
gesis_data
.
gesis_file_types
gives an overview of the file categories, i.e.
datasets, questionnaires, codebooks or other documents, that are available
for a specific record.
Arguments
- record
Object of class
gesis_record
as returned bygesis_search
andgesis_get
or dataset ID. If a dataset ID is passed, the function performs a call togesis_get
.- type
Type of data to download. Must be one of
"dataset"
,"questionnaire"
,"codebook"
,"otherdocs"
, or"uncategorized"
. A file type is "uncategorized" if it is falls under none of the other file types. Defaults to"dataset"
. A list of available data types for a given record can be retrieved usinggesis_file_types
.
Value
gesis_files
returns a list of class gesis_file
containing information about the file name, format, size, download URL, and
whether the file needs a login to download.
gesis_file_types
returns a character vector containing the file
types that are available. If "none"
, files are available but not
categorized. If NULL
, no files are available for download.
Examples
# check what file types are available
gesis_file_types("ZA3753")
#> [1] "dataset" "questionnaire" "codebook" "otherdocs"
# show all dataset files for ALLBUS 1998
gesis_files("ZA3753")
#> <gesis_files>
#> → File 1
#> Label: ZA3753.por
#> Format: application/x-spss-por
#> File size: 3.53 MB
#> Login required? yes
#> ────
#> → File 2
#> Label: ZA3753.sav
#> Format: application/x-spss-sav
#> File size: 2.55 MB
#> Login required? yes
#> ────
#> → File 3
#> Label: ZA3753_missing.sps
#> File size: 0.02 MB
#> Login required? yes
#> ────
#> → File 4
#> Label: ZA3753_variable-list.txt
#> File size: 0.02 MB
#> Login required? yes
#> ────
#> → File 5
#> Label: ZA3753_v1-0-0.dta.zip
#> File size: 0.64 MB
#> Login required? yes
# show all of its questionnaire files
gesis_files("ZA3753", type = "questionnaire")
#> <gesis_files>
#> → File 1
#> Label: ZA3000_fb.pdf
#> Login required? no
#> ────
#> → File 2
#> Label: ZA3753_q.pdf
#> Login required? no
# other record types can have files, too
type <- gesis_file_types("pretest-129")
gesis_files("pretest-129", type = "uncategorized")
#> <gesis_files>
#> → File 1
#> Label: Projektbericht