get_resource: Get resource metadata

Description Usage Arguments Details See Also Examples

Description

Missing properties are returned filled with their default values (see Details). If inline_data = TRUE and property path is NULL, object data is returned in the data property either unchanged (if format is missing or "json") or formatted as a string (provided the format is supported).

Usage

1
2
3
get_resource(x, name = NULL, inline_data = TRUE)

get_resources(l, inline_data = FALSE)

Arguments

x

Object.

name

(character) Resource name to return if not set explicitly.

inline_data

(logical) Whether to include the contents of x as inline data ($data).

l

(list) List of objects.

Details

Unless set explicity, the following defaults are returned:

See Also

Other resource functions: get_package, resource, set_resources, set_resource

Examples

1
2
3
4
5
6
7
8
9
x <- data.frame(id = 1L, value = 1.1)
get_resource(x)
get_resource(x, "data")
l <- set_resources(
  list(a = data.frame(), b = data.frame(x = 1)),
  a = resource(path = "data/a.csv"),
  b = resource(path = "data/b.csv")
)
get_resources(l)

ezwelty/dpkg documentation built on May 30, 2019, 7:19 a.m.