add.stpoints: Add space-time points to a stpp object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/add.stpoints.R

Description

This function adds new points to a stpp object.

Usage

1

Arguments

X

A space-time object of class “stpp” to add points to.

points

A vector, data frame, matrix or list of points to be added to X.

Details

points can be a vector of length three describing one x, y, and t coordinate, or a matrix or data frame where the first column is a column of x coordinates, the second column is a column of y coordinates, and the third column is a column of t coordinates. If points is a list, the first entry is a vector of x coordinates, the second entry is a vector of y coordinates, and the third entry is a vector of t coordinates.

Value

add.stpoints returns an object of class “stpp”.

Author(s)

Robert Clements

See Also

stpp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#===> create a stpp object <===#
x <- rnorm(30, mean = 10, sd = 1)
y <- rnorm(30, mean = 100, sd = 10)
t <- runif(30, 0, 100)
stw <- stwin(xcoord = c(0, 20), ycoord = c(50, 150), tcoord = c(0, 100))
X <- stpp(x, y, t, stw = stw)

#===> add new points to X <===#
x.new <- rnorm(10, mean = 10, sd = 1)
y.new <- rnorm(10, mean = 100, sd = 10)
t.new <- runif(10, 0, 100)
all.new <- data.frame(cbind(x.new, y.new, t.new))
Y <- add.stpoints(X, all.new)

stppResid documentation built on May 29, 2017, 3:48 p.m.