|
1 | | -\name{approxNA} |
| 1 | +\name{approximate} |
2 | 2 |
|
3 | 3 | \docType{methods} |
4 | 4 |
|
5 | | -\alias{approxNA} |
6 | | -\alias{approxNA,SpatRaster-method} |
| 5 | +\alias{approximate} |
| 6 | +\alias{approximate,SpatRaster-method} |
7 | 7 |
|
8 | 8 | \title{Estimate values for cell values that are \code{NA} by interpolating between layers} |
9 | 9 |
|
10 | 10 | \description{ |
11 | | -approxNA uses the \code{stats} function \code{\link{approx}} to estimate values for cells that are \code{NA} by interpolation across layers. Layers are considered equidistant, unless argument \code{z} is used, or \code{time(x)} returns values that are not \code{NA}, in which case these values are used to determine distance between layers. |
| 11 | +approximate uses the \code{stats} function \code{\link{approx}} to estimate values for cells that are \code{NA} by interpolation across layers. Layers are considered equidistant, unless argument \code{z} is used, or \code{time(x)} returns values that are not \code{NA}, in which case these values are used to determine distance between layers. |
12 | 12 |
|
13 | 13 | For estimation based on neighboring cells see \code{\link{focal}} |
14 | 14 | } |
15 | 15 |
|
16 | 16 | \usage{ |
17 | | -\S4method{approxNA}{SpatRaster}(x, method="linear", yleft, yright, |
| 17 | +\S4method{approximate}{SpatRaster}(x, method="linear", yleft, yright, |
18 | 18 | rule=1, f=0, ties=mean, z=NULL, NArule=1,filename="", ...) |
19 | 19 | } |
20 | 20 |
|
@@ -52,9 +52,9 @@ r2[5:15] <- NA |
52 | 52 | r3[8:25] <- NA |
53 | 53 | s <- c(r1,r2,r3,r4,r5,r6) |
54 | 54 | s[1:5] <- NA |
55 | | -x1 <- approxNA(s) |
56 | | -x2 <- approxNA(s, rule=2) |
57 | | -x3 <- approxNA(s, rule=2, z=c(1,2,3,5,14,15)) |
| 55 | +x1 <- approximate(s) |
| 56 | +x2 <- approximate(s, rule=2) |
| 57 | +x3 <- approximate(s, rule=2, z=c(1,2,3,5,14,15)) |
58 | 58 |
|
59 | 59 | } |
60 | 60 |
|
|
0 commit comments