Learn R Programming

inlabru (version 2.1.9)

cprod: Cross product of integration points

Description

Calculates the cross product of integration points in different dimensions and multiplies their weights accordingly. If the object defining points in a particular dimension has no weights attached to it all weights are assumend to be 1.

Usage

cprod(...)

Arguments

...

data.frame or SpatialPointsDataFrame objects, each one usually obtained by a call to the ipoints function.

Value

A data.frame or SpatialPointsDataFrame of multidimensional integration points and their weights

Examples

Run this code
# NOT RUN {
# ipoints needs INLA
if (require("INLA", quietly = TRUE)) {
# Create integration points in dimension 'myDim' and 'myDiscreteDim' 
ips1 = ipoints(c(0,8), name = "myDim")
ips2 = ipoints(as.integer(c(1,2,3)), name = "myDiscreteDim")

# Calculate the cross product
ips = cprod(ips1, ips2)

# Plot the integration points
plot(ips$myDim, ips$myDiscreteDim, cex = 10*ips$weight)
}
# }

Run the code above in your browser using DataLab