Skip to contents

This functions create the resource metadata

Usage

resource_metadata(
  type = NULL,
  url = NULL,
  name = NULL,
  description = NULL,
  format = NULL,
  file_type = NULL,
  date_range_start = NULL,
  date_range_end = NULL,
  upload = NULL,
  visibility = NULL,
  version = NULL,
  `hxl-ated` = NULL,
  process_status = NULL,
  identifiability = NULL,
  ...
)

Arguments

type

Resource type(*) - The kind of file you want to upload. Allowed values: data (Data file), attachment (Additional attachment).

url

Upload - The file name as it will be recorded in the system.

name

Name - eg. January 2011 Gold Prices.

description

Description - Some usefule notes about the data.

format

File format - eg. CSV, XML, or JSON.

file_type

File type(*) - Indicates what is contained in the file. Allowed values: microdata (Microdata), questionnaire (Questionnaire), report (Report), sampling_methodology (Sampling strategy & methodology Description), infographics (Infographics & Dashboard), script (Script), concept note (Concept Note), other (Other).

date_range_start

Data collection first date(*) - Use yyyy-mm-dd format.

date_range_end

Data collection last date(*) - Use yyyy-mm-dd format.

upload

File to upload. Passed using httr::upload_file().

visibility

should be either

version

Version(*).

process_status

File process status(*) - Indicates the processing stage of the data. 'Raw' means that the data has not been cleaned since collection. 'In process' means that it is being cleaned. 'Final' means that the dataset is final and ready for use in analytical products. Allowed valued: raw (Raw-Uncleaned), cleaned (Cleaned Only), anonymized (Cleaned & Anonymized).

identifiability

Identifiability(*) - Indicates if personally identifiable data is contained in the dataset. Allowed values: personally_identifiable (Personally identifiable), anonymized_enclave (Anonymized 1st level: Data Enclave - only removed direct identifiers), anonymized_scientific (Anonymized 2st level: Scientific Use File (SUF)), anonymized_public (Anonymized 3st level: Public Use File (PUF)).

...

ignored.

`hxl-ated`

HXL-ated. Allowed values: False (No), True (Yes).

Value

A list with the provided metadata.

Details

All arguments are of type character.

Fields marked with a (*) are required for resource_create() and resource_update() operations.

Examples

#resource_metadata()
m <- riddle::resource_metadata(type = "data",
                       url = "mtcars.csv",
                       name = "mtcars.csv",
                       format = "csv",
                       file_type = "microdata",
                       date_range_start = "1973-01-01",
                       date_range_end = "1973-12-31",
                       version = "1",
                       visibility = "public",
                       process_status = "raw",
                       identifiability = "anonymized_public")
m
#> $type
#> [1] "data"
#> 
#> $url
#> [1] "mtcars.csv"
#> 
#> $name
#> [1] "mtcars.csv"
#> 
#> $format
#> [1] "csv"
#> 
#> $file_type
#> [1] "microdata"
#> 
#> $date_range_start
#> [1] "1973-01-01"
#> 
#> $date_range_end
#> [1] "1973-12-31"
#> 
#> $visibility
#> [1] "public"
#> 
#> $version
#> [1] "1"
#> 
#> $process_status
#> [1] "raw"
#> 
#> $identifiability
#> [1] "anonymized_public"
#>