get_resource: Get one or more resources or all resources within a package.

View source: R/get_resource.R

get_resourceR Documentation

Get one or more resources or all resources within a package.

Description

Get data from one or more resources, or all resources within a package, as a list, with each resource in tabular format. Where field selection and/or filtering of data is required the get_data function can be used.

Usage

get_resource(package = NULL, resource = NULL, limit = Inf)

Arguments

package

A character vector specifying package ids or names. If the resource argument is not provided all resources under each of the specified packages will be returned. The package argument itself is optional, but one of package or resource arguments must be provided.

resource

A character vector specifying resource ids or names. If the package argument is also provided then resources will only be returned if they exist under one of the specified packages, otherwise each of the specified resources will be returned. The resource argument itself is optional, but one of resource or package arguments must be provided.

limit

A numeric value specifying the maximum number of rows to be returned. Default value Inf returns all rows. Note; when multiple resources are returned the limit applies to each.

Value

A list containing all the resources within a package, or those specified, as data.frames.

Examples

## Not run: 
get_resource(
  package = "4dd86111-7326-48c4-8763-8cc4aa190c3e",
  limit = 5L
  )
  
get_resource(
  package = "4dd86111-7326-48c4-8763-8cc4aa190c3e",
  resource = "edee9731-daf7-4e0d-b525-e4c1469b8f69",
  limit = 5L
  )

get_resource(
  package = "standard-populations",
  resource = "European Standard Population",
  limit = 5L
  )
  
 get_resource(
  resource = "European Standard Population",
  limit = 5L
  )

## End(Not run)
 

odns documentation built on Nov. 10, 2022, 5:56 p.m.