Crunch datasets are collected in folders called "projects". datasets()
can
be used to filter a project's contents to see only datasets (and not other
projects). You can also use it to pull a catalog of datasets from search
results.
datasets(x = getAPIRoot())
datasets(x) <- value
a ProjectFolder
or SearchResults
that may contain datasets
For assignment, a CrunchDataset
to move
When x
is a ProjectFolder
, datasets()
returns the folder with
its "index" filtered to contain only datasets; otherwise, it returns an
object of class DatasetCatalog
. The assignment function returns the
project x
with the given dataset added to it.
The datasets()<-
assignment function provides an alternative method for
moving a dataset into a project. This may be more convenient in some cases
than using mv()
.
if (FALSE) {
# Get the names of the datasets contained in a project
projects() %>%
cd("Important Clients") %>%
datasets() %>%
names()
# The assignment method lets you move a dataset to a project
proj <- cd(projects(), "Important Clients")
ds <- loadDataset("New important client survey")
datasets(proj) <- ds
}