Skip to content

Commit 2c4831e

Browse files
committed
c
1 parent 1eca6de commit 2c4831e

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: raster
22
Type: Package
33
Title: Geographic Data Analysis and Modeling
4-
Version: 3.6-24
5-
Date: 2023-10-05
4+
Version: 3.6-26
5+
Date: 2023-10-12
66
Imports: Rcpp, methods, terra (>= 1.7-29)
77
LinkingTo: Rcpp
88
Depends: sp (>= 1.4-5), R (>= 3.5.0)

NEWS

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ calc failed when writing to disk if the supplied function returned multiple laye
5555
reclassify bug reported by Jacub Nowasad. https://github.com/rspatial/raster/issues/62
5656
extract failed for sf objects with a Z dimension. https://github.com/rspatial/raster/issues/64
5757

58-
More generics and namespace exports for compatability with "terra"
58+
More generics and namespace exports for compatibility with "terra"
5959

6060
--- 10-July-2019, version: 2.9-22
6161
New (hidden) function ".ifel", that is, ifelse for Raster objects (this is the R implementation of the arcpy "Con" method)
62-
New (hidden) function ".ifel", that is, ifelse for Raster objects (this is the R implementation of the arcpy "Con" method)
63-
Lots of namespace export additions for compatability with "terra"
62+
Lots of namespace export additions for compatibility with "terra"
6463
Old .Call code replaced with Rcpp based code
6564

6665
Bug fixes:

man/movingFun.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ movingFun(x, n, fun=mean, type='around', circular=FALSE, na.rm=FALSE)
1717
\item{x}{A vector of numbers}
1818
\item{n}{Size of the 'window', i.e. the number of sequential elements to use in the function}
1919
\item{fun}{A function like mean, min, max, sum}
20-
\item{type}{Character. One of 'around', 'to', or 'from'. The choice indicates which values should be used in the computation. The focal element is always used. If \code{type} is 'around', the other elements are before and after the focal element. Alternatively, you can select the elements preceding the focal element ('to') or those coming after it {'from'}. For example, to compute the movingFun with \code{n=3} for element 5 of a vector; 'around' used elements 4,5,6; 'to' used elements 3,4,5, and 'from' uses elements 5,6,7}
20+
\item{type}{Character. One of 'around', 'to', or 'from'. The choice indicates which values should be used in the computation. The focal element is always used. If \code{type} is 'around', the other elements are before and after the focal element. Alternatively, you can select the elements preceding the focal element ('to') or those coming after it ('from'). For example, to compute the movingFun with \code{n=3} for element 5 of a vector; 'around' used elements 4,5,6; 'to' used elements 3,4,5, and 'from' uses elements 5,6,7}
2121
\item{circular}{Logical. If \code{TRUE}, the data are considered to have a circular nature (e.g. months of the year), and the last elements in vector \code{x} are used in the computation of the moving function of the first element(s) of the vector, and the first elements are used in the computation of the moving function for the last element(s)}
2222
\item{na.rm}{Logical. If \code{TRUE}, \code{NA} values should be ingored (by \code{fun})}
2323
}

man/rasterize.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If \code{x} represents points, each point is assigned to a grid cell. Points tha
4646
\item{fun}{function or character. To determine what values to assign to cells that are covered by multiple spatial features. You can use functions such as \code{min, max}, or \code{mean}, or one of the following character values: \code{'first'}, \code{'last'}, \code{'count'}. The default value is \code{'last'}. In the case of SpatialLines*, \code{'length'} is also allowed (currently for planar coordinate systems only).
4747

4848

49-
If \code{x} represents points, \code{fun} must accept a \code{na.rm} argument, either explicitly or through 'dots'. This means that \code{fun=length} fails, but \code{fun=function(x,...)length(x)} works, although it ignores the \code{na.rm} argument. To use the \code{na.rm} argument you can use a function like this: fun=function(x, na.rm){if (na.rm) length(na.omit(x)) else (length(x)}, or use a function that removes \code{NA} values in all cases, like this function to compute the number of unique values per grid cell "richness": \code{fun=function(x, ...) {length(unique(na.omit(x)))} }. If you want to count the number of points in each grid cell, you can use \code{ fun='count'} or \code{fun=function(x,...){length(x)}}.
49+
If \code{x} represents points, \code{fun} must accept a \code{na.rm} argument, either explicitly or through the ellipses ('dots'). This means that \code{fun=length} fails, but \code{fun=function(x,...)length(x)} works, although it ignores the \code{na.rm} argument. To use the \code{na.rm} argument you can use a function like this: \code{fun=function(x, na.rm){if (na.rm) length(na.omit(x)) else (length(x)}}, or use a function that removes \code{NA} values in all cases, like this function to compute the number of unique values per grid cell "richness": \code{fun=function(x, ...) {length(unique(na.omit(x)))} }. If you want to count the number of points in each grid cell, you can use \code{ fun='count'} or \code{fun=function(x,...){length(x)}}.
5050

5151
You can also pass multiple functions using a statement like \code{fun=function(x, ...) c(length(x),mean(x))}, in which case the returned object is a RasterBrick (multiple layers).
5252
}

man/terrain.Rd

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TRI <- focal(x, w=f, fun=function(x, ...) sum(abs(x[-5]-x[5]))/8, pad=TRUE, padV
4747

4848
TPI <- focal(x, w=f, fun=function(x, ...) x[5] - mean(x[-5]), pad=TRUE, padValue=NA)
4949

50-
rough <- focal(x, w=f, fun=function(x, ...) {max(x) - min(x)}, pad=TRUE, padValue=NA, na.rm=TRUE)
50+
rough <- focal(x, w=f, fun=function(x, ...) max(x) - min(x), pad=TRUE, padValue=NA, na.rm=TRUE)
5151
}
5252

5353

man/writeRaster.Rd

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ When writing a file to disk, the file format is determined by the 'format=' argu
2525
\item{format}{Character. Output file type. See \code{\link[raster]{writeFormats}}. If this argument is not provided, it is attempted to infer it from the filename extension. If that fails, the default format is used. The default format is 'raster', but this can be changed using \code{\link{rasterOptions}}}
2626
\item{...}{Additional arguments:
2727

28-
\code{datatype}{Character. Output data type (e.g. 'INT2S' or 'FLT4S').
29-
See \code{\link{dataType}}. If no datatype is specified, 'FLT4S' is used,
30-
unless this default value was changed with \code{\link{rasterOptions}}}
28+
\code{datatype}: Character. Output data type (e.g. 'INT2S' or 'FLT4S'). See \code{\link{dataType}}. If no datatype is specified, 'FLT4S' is used, unless this default value was changed with \code{\link{rasterOptions}}
3129

3230
\code{overwrite}: Logical. If TRUE, "filename" will be overwritten if it exists
3331

0 commit comments

Comments
 (0)