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"),
...
)
A catalog object
A character vector of elements to use as row labels for the
resulting data.frame, or NULL
, the default, adds no row labels.
part of as.data.frame
signature. Ignored.
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
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.
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")
.
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))
}