remove_basis function

Removes basis functions

Removes basis functions

Takes an object of class Basis and returns an object of class Basis with selected basis functions removed

remove_basis(Basis, rmidx) ## S4 method for signature 'Basis,ANY' remove_basis(Basis, rmidx) ## S4 method for signature 'Basis,SpatialPolygons' remove_basis(Basis, rmidx)

Arguments

  • Basis: object of class Basis
  • rmidx: indices of basis functions to remove. Or a SpatialPolygons object; basis functions overlapping this SpatialPolygons object will be retained

Examples

library(sp) df <- data.frame(x = rnorm(10), y = rnorm(10)) coordinates(df) <- ~x+y G <- auto_basis(plane(),df,nres=1) data.frame(G) # Print info on basis ## Removing basis functions by index G_subset <- remove_basis(G, 1:(nbasis(G)-1)) data.frame(G_subset) ## Removing basis functions using SpatialPolygons x <- 1 poly <- Polygon(rbind(c(-x, -x), c(-x, x), c(x, x), c(x, -x), c(-x, -x))) polys <- Polygons(list(poly), "1") spatpolys <- SpatialPolygons(list(polys)) G_subset <- remove_basis(G, spatpolys) data.frame(G_subset)

See Also

auto_basis for automatically constructing basis functions and show_basis for visualising basis functions

  • Maintainer: Andrew Zammit-Mangion
  • License: GPL (>= 2)
  • Last published: 2024-07-16