setClass("h5array", representation(
file = "character",
location = "character",
dimnames = "listOrNULL"
),
prototype(
file = tempfile(),
location = "Data",
dimnames = NULL
))
h5array <- function( fn, location ){
stopifnot(file.exists(fn)) # Need more sanity checks here
new("h5array", file = fn, location = location)
}
h5arrayCreate <- function( fn, location, dim, storage.mode, ... ){
if(!file.exists(fn)){
h5createFile(fn)
}
h5createDataset(fn, location, dims = dim, storage.mode = storage.mode, ...)
new("h5array", file = fn, location = location)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.