bru_mapper: Constructors for 'bru_mapper' objects

View source: R/mappers.R

bru_mapperR Documentation

Constructors for bru_mapper objects

Description

Constructors for bru_mapper objects

Usage

bru_mapper(...)

bru_mapper_define(mapper, new_class = NULL, ..., methods = deprecated())

## Default S3 method:
bru_mapper(...)

Arguments

...

Arguments passed on to sub-methods, or used for special purposes, see details for each function below.

mapper

For bru_mapper_define, a prototype mapper object, see Details. For bru_mapper_scale, a mapper to be scaled.

new_class

If non-NULL, this is added at the front of the class definition

methods

[Deprecated] Deprecated.

Value

  • bru_mapper() returns a bru_mapper object

Methods (by class)

  • bru_mapper(default): Calls bru_mapper_define, passing all arguments along. Mapper implementations should call bru_mapper_define() instead, and supply at least a new_class class name. Use of the bru_mapper.default method will be deprecated from version 2.7.0.

Functions

  • bru_mapper(): Generic mapper S3 constructor, used for constructing mappers for special objects. See below for details of the default constructor bru_mapper_define() that can be used to define new mappers in user code.

  • bru_mapper_define(): Adds the new_class and "bru_mapper" class names to the inheritance list for the input mapper object, unless the object already inherits from these.

    To register mapper classes and methods in scripts, use .S3method() to register the methods, e.g. .S3method("ibm_jacobian", "my_mapper_class", ibm_jacobian.my_mapper_class).

    In packages with Suggests: inlabru, add method information for delayed registration, e.g.:

    #' @rawNamespace S3method(inlabru::bru_get_mapper, inla_rspde)
    #' @rawNamespace S3method(inlabru::ibm_n, bru_mapper_inla_rspde)
    #' @rawNamespace S3method(inlabru::ibm_values, bru_mapper_inla_rspde)
    #' @rawNamespace S3method(inlabru::ibm_jacobian, bru_mapper_inla_rspde)
    

    or before each method, use ⁠@exportS3Method⁠:

    #' @exportS3Method inlabru::bru_get_mapper
    

    etc., which semi-automates it.

See Also

bru_mapper_generics for generic methods, the individual mapper pages for special method implementations, and bru_get_mapper for hooks to extract mappers from latent model object class objects.

Other mappers: bru_get_mapper(), bru_mapper.fm_mesh_1d(), bru_mapper.fm_mesh_2d(), bru_mapper_aggregate(), bru_mapper_collect(), bru_mapper_const(), bru_mapper_factor(), bru_mapper_generics, bru_mapper_harmonics(), bru_mapper_index(), bru_mapper_linear(), bru_mapper_logsumexp(), bru_mapper_marginal(), bru_mapper_matrix(), bru_mapper_mesh_B(), bru_mapper_multi(), bru_mapper_pipe(), bru_mapper_scale(), bru_mapper_shift(), bru_mapper_taylor()

Examples

mapper <- bru_mapper_index(5)
ibm_jacobian(mapper, input = c(1, 3, 4, 5, 2))

inlabru-org/inlabru documentation built on March 23, 2024, 11:36 a.m.