Skip to content

Commit

Permalink
Merge branch 'r-spatial:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
darentsai authored May 19, 2024
2 parents 55685d4 + 5dbe096 commit 37e01c2
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 202 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/rcmdcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: rcmdcheck

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-tinytex@v2

- name: Install additional LaTeX packages
run: tlmgr install grfext multirow caption setspace

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
145 changes: 0 additions & 145 deletions .github/workflows/tic.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
gstat
=====
<!-- badges: start -->
[![R-CMD-check](https://github.com/r-spatial/gstat/workflows/tic/badge.svg)](https://github.com/r-spatial/gstat/actions)
[![R-CMD-check](https://github.com/r-spatial/gstat/workflows/rcmdcheck/badge.svg)](https://github.com/r-spatial/gstat/actions/workflows/rcmdcheck.yml)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/r-spatial/gstat?branch=master&svg=true)](https://ci.appveyor.com/project/edzerpebesma/gstat)
[![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
[![CRAN](http://www.r-pkg.org/badges/version/gstat)](https://cran.r-project.org/package=gstat)
Expand Down
7 changes: 4 additions & 3 deletions man/vgm.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ as.vgm.variomodel(m)
}
\arguments{
\item{psill}{ (partial) sill of the variogram model component, or model: see Details }
\item{model}{ model type, e.g. "Exp", "Sph", "Gau", "Mat". Calling vgm() without
a model argument returns a data.frame with available models. }
\item{model}{ model type, e.g. "Exp", "Sph", "Gau", or "Mat". Can be a character vector of model
types combined with c(), e.g. c("Exp", "Sph"), in which case the best fitting is returned.
Calling vgm() without a model argument returns a data.frame with available models. }
\item{range}{ range parameter of the variogram model component; in case of anisotropy: major range }
\item{kappa}{ smoothness parameter for the Matern class of variogram
models }
Expand Down Expand Up @@ -59,7 +60,7 @@ to vgm.
}
\author{ Edzer Pebesma }
\details{ If only the first argument (\code{psill}) is given a
\code{character} value indicating a model, as in \code{vgm("Sph")},
\code{character} value/vector indicating one or more models, as in \code{vgm("Sph")},
then this taken as a shorthand form of \code{vgm(NA,"Sph",NA,NA)},
i.e. a spherical variogram with nugget and unknown parameter values;
see examples below. Read \link{fit.variogram} to find out how
Expand Down
4 changes: 3 additions & 1 deletion tests/unproj.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
suppressPackageStartupMessages(library(sp))
library(gstat)

if (require(sp, quietly = TRUE) && require(fields, quietly = TRUE) && require(sf, quietly = TRUE)) {
if (require(sp, quietly = TRUE) &&
suppressPackageStartupMessages(require(fields, quietly = TRUE)) &&
suppressPackageStartupMessages(require(sf, quietly = TRUE))) {
data(meuse)
coordinates(meuse) = ~x+y
proj4string(meuse) = CRS("+init=epsg:28992")
Expand Down
25 changes: 6 additions & 19 deletions tests/unproj.Rout.save
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
Expand All @@ -21,7 +21,9 @@ Type 'q()' to quit R.
> suppressPackageStartupMessages(library(sp))
> library(gstat)
>
> if (require(sp, quietly = TRUE) && require(fields, quietly = TRUE) && require(sf, quietly = TRUE)) {
> if (require(sp, quietly = TRUE) &&
+ suppressPackageStartupMessages(require(fields, quietly = TRUE)) &&
+ suppressPackageStartupMessages(require(sf, quietly = TRUE))) {
+ data(meuse)
+ coordinates(meuse) = ~x+y
+ proj4string(meuse) = CRS("+init=epsg:28992")
Expand Down Expand Up @@ -72,21 +74,6 @@ Type 'q()' to quit R.
+ cat('==========\nspDistsN1 Distances:\n')
+ print(spDistsN1(coordinates(foo), coordinates(foo)[1,], longlat=TRUE))
+ }
Spam version 2.9-1 (2022-08-07) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

backsolve, forwardsolve


Try help(fields) to get started.
Linking to GEOS 3.11.1, GDAL 3.6.2, PROJ 9.1.1; sf_use_s2() is TRUE
==========
variogram:
dist gamma dir.hor dir.ver id left right
Expand All @@ -106,4 +93,4 @@ In CPL_crs_from_input(x) :
>
> proc.time()
user system elapsed
2.028 0.818 1.946
1.466 1.314 1.282
8 changes: 0 additions & 8 deletions tic.R

This file was deleted.

0 comments on commit 37e01c2

Please sign in to comment.