remove_basis | R Documentation |
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)
Basis |
object of class |
rmidx |
indices of basis functions to remove. Or a |
auto_basis
for automatically constructing basis functions and show_basis
for visualising basis functions
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.