Skip to content

Commit

Permalink
variogram.formula accepts stars objects
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Mar 21, 2024
1 parent 08f2883 commit c8be3e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# version 2.1-2

* `variogram()` supports `stars` (raster) objects, benefiting from them being gridded

# version 2.1-1

# version 2.1-0

* import `sftime`; modify `krigeST()` variogram functions to accept `sftime` objects for `data` (as alternative to `STI` or `STIDF`), and `stars` or `sftime` objects for `newdata`; #108 with great help from @henningte
Expand Down
2 changes: 1 addition & 1 deletion R/variogram.formula.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"variogram.formula" <-
function (object, locations = coordinates(data), data, ...)
{
if ((missing(locations) && inherits(data, "sf")) || (inherits(locations, "sf"))) {
if ((missing(locations) && inherits(data, c("sf", "stars"))) || (inherits(locations, c("sf", "stars")))) {
if (!requireNamespace("sf", quietly = TRUE))
stop("sf required: install that first") # nocov
if (missing(locations))
Expand Down

0 comments on commit c8be3e8

Please sign in to comment.