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

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

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

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

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

# S3 method for 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

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.

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").

Examples

if (FALSE) {
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))
}