catalog-dataframes: as.data.frame method for catalog objects

catalog-dataframesR Documentation

as.data.frame method for catalog objects

Description

This method gives you a view of a catalog, such as a VariableCatalog, as a data.frame in order to facilitate further exploration.

Usage

## S3 method for class 'VariableCatalog'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  keys = c("alias", "name", "type"),
  ...
)

## S3 method for class 'ShojiCatalog'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

## S3 method for class 'BatchCatalog'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  keys = c("id", "status"),
  ...
)

## S3 method for class 'FilterCatalog'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  keys = c("name", "id", "is_public"),
  ...
)

## S3 method for class 'UserCatalog'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  keys = c("name", "email", "teams", "collaborator"),
  ...
)

Arguments

x

A catalog object

row.names

A character vector of elements to use as row labels for the resulting data.frame, or NULL, the default, adds no row labels.

optional

part of as.data.frame signature. Ignored.

keys

A character vector of the catalog attributes that you would like included in the data.frame. To include all attributes, set keys to TRUE, which is the default for some catalogs. Other catalog classes specify a narrower default:

  • VariableCatalog: c("alias", "name", "type")

  • BatchCatalog: c("id", "status")

  • FilterCatalog: c("name", "id", "is_public")

...

Additional arguments passed to data.frame

Details

Modifying the data.frame produced by this function will not update the objects on the Crunch server. Other methods exist for updating the metadata in the variable catalog, for example. See vingette("variables", package = "crunch").

Value

A data.frame including metadata about each entity contained in the catalog. The fields in the data.frame match the keys argument provided to the function, and each row represents a entity.

Examples

## Not run: 
ds <- loadDataset("iris")
vars <- variables(ds)
var_df <- as.data.frame(vars, keys = TRUE)
# With row names
as.data.frame(vars, row.names = urls(vars))

## End(Not run)


crunch documentation built on Aug. 31, 2023, 1:07 a.m.