Learn R Programming

bitfield (version 1.0.0)

bf_registry: Initiate a new registry

Description

Initiate a new registry

Usage

bf_registry(
  name,
  description,
  template,
  author = NULL,
  project = NULL,
  license = "MIT"
)

Value

an empty registry that captures some metadata of the bitfield, but doesn't contain any flags yet.

Arguments

name

character(1)
the name of the bitfield.

description

character(1)
the description of the bitfield.

template

the data object that serves as a template for the bitfield structure. Can be a data.frame (or tibble) or a SpatRaster. The template determines the output format of bf_encode and bf_decode.

author

person(.)
the author(s) involved in the creation of this registry.

project

list(1)
object created with the function project that documents the project metadata.

license

character(1)
license or rights statement.

Examples

Run this code
auth <- person(given = "Jane", family = "Smith",
               email = "jane@example.com", role = c("cre", "aut"))

proj <- project(title = "example project",
                people = c(person("Jane", "Smith", email = "jane@example.com",
                                  role = "aut"),
                           person("Robert", "Jones", role = c("aut", "cre"))),
                publisher = "example publisher",
                type = "Dataset",
                identifier = "10.5281/zenodo.1234567",
                description = "A comprehensive explanation",
                subject = c("keyword", "subject"),
                license = "CC-BY-4.0")

# with a data.frame template
reg <- bf_registry(name = "currentWorkflow",
                   description = "the registry to my modelling pipeline",
                   template = bf_tbl,
                   author = auth,
                   project = proj)

# with a raster template
library(terra)
bf_rst <- rast(nrows = 3, ncols = 3, vals = 1:9)
reg <- bf_registry(name = "rasterWorkflow",
                   description = "raster-based bitfield",
                   template = bf_rst)

Run the code above in your browser using DataLab