add_resource | R Documentation |
This function adds a hub resource to the AH or EH package metadata.csv file. It can be used while creating a new hub package or for adding data to an existing package.
add_resource(package, fields, metafile = "metadata.csv")
package |
A |
fields |
A named list with the data to be added to the
resource. Elements and content of the list are described in |
metafile |
A |
Path to metadata file where resource was added
## create a mock package
pkgdir <- tempdir()
create_pkg(file.path(pkgdir, "recordPkg"), "ExperimentHub")
## create a metadata record
meta <- hub_metadata(
Title = "ENCODE",
Description = "a test entry",
BiocVersion = "4.1",
Genome = NA_character_,
SourceType = "JSON",
SourceUrl = "https://www.encodeproject.org",
SourceVersion = "x.y.z",
Species = NA_character_,
TaxonomyId = as.integer(9606),
Coordinate_1_based = NA,
DataProvider = "ENCODE Project",
Maintainer = "tst person <tst@email.com>",
RDataClass = "data.table",
DispatchClass = "Rda",
Location_Prefix = "s3://annotationhub/",
RDataPath = "ENCODExplorerData/encode_df_lite.rda",
Tags = "ENCODE:Homo sapiens"
)
## add the record to the metadata
add_resource(file.path(pkgdir, "recordPkg"), meta)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.