This function allows to download all publicly available versions of Metapsy databases into your R environment.
getData(shorthand, version = NULL, include.metadata = TRUE)
include.metadata is set to
will return both the requested dataset itself, as well as the metadata associated
within in it. Metadata items included by default are:
database.doi: The digital object identifier of the database ("Concept DOI"
in the Zenodo API. This DOI will always resolve to the
latest database version).
documentation.url: URL of the database documentation entry on the
Metapsy Documentation page.
github.repo.url: URL of the specific Github repository state at which the
database was released.
last.search: Date of the last search.
last.updated: Date of the last database updated (release).
license: License of the database.
repository.download.url: Link to download the entire database from Zenodo.
title: Title of the database (including its version).
variable.description: Description of the variables included in the dataset.
version: Version of the database.
version.doi: DOI associated with the specific version of the database. In contrast to
database.doi, this identifier will also link to this specific database version.
R6::R6Class() object also contains a few helpful functions,
which can be called directly from the object:
downloadZip(): This will download the database (including metadata) as a
.zip file from its Zenodo repository.
openDocumentation(): This opens the database documentation entry on
the Metapsy Documentation page.
openGitRepo(): This opens the Github repository of the database at the state of
returnMetadata(): Returns the entire metadata stored in the
R6 object as a
variableDescription(): This prints a variable description of the database
in the R Console.
FALSE, the function will return the dataset
as a simple
Mathias Harrer firstname.lastname@example.org
## Not run: # List all available databases listData() # Get latest version of the 'depression-psyctr' database d <- getData("depression-psyctr") # Get version 22.2.0 of the 'depression-psyctr' database d <- getData("depression-psyctr", "22.2.0") # Show variable description d$variableDescription() # Open online documentation d$openDocumentation() # Analyze using metapsyTools library(metapsyTools) runMetaAnalysis(d) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.