Skip to content

Commit

Permalink
weorking version of vignette with 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Nychka committed May 7, 2021
1 parent b2c13c9 commit 27d6ddf
Show file tree
Hide file tree
Showing 3,256 changed files with 182,978 additions and 859 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
58 changes: 58 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/DESCRIPTION
@@ -0,0 +1,58 @@
Package: fields
Version: 12.0
Date: 2021-05-06
Title: Tools for Spatial Data
Authors@R: c( person("Douglas", "Nychka", role = c("aut", "cre"),
email = "douglasnychka@gmail.com"),
person("Reinhard", "Furrer", role = c("aut"),
email = "reinhard.furrer@math.uzh.ch"),
person("John", "Paige", role = c("aut"),
email = "paigejo@uw.edu"),
person("Stephan", "Sain", role = "aut",
email = "sainsr2@gmail.com"),
person("Florian", "Gerber", role = "aut",
email = "flora.fauna.gerber@gmail.com"),
person("Matthew", "Iverson", role = "aut",
email = "miverson@mymail.mines.edu"),
person("University Corporation for Atmospheric Research",
role="cph", email="nychka@ucar.edu")
)
Maintainer: Douglas Nychka <douglasnychka@gmail.com>
Description: For curve, surface and function fitting with an emphasis
on splines, spatial data, geostatistics, and spatial statistics. The major methods
include cubic, and thin plate splines, Kriging, and compactly supported
covariance functions for large data sets. The splines and Kriging methods are
supported by functions that can determine the smoothing parameter
(nugget and sill variance) and other covariance function parameters by cross
validation and also by restricted maximum likelihood. For Kriging
there is an easy to use function that also estimates the correlation
scale (range parameter). A major feature is that any covariance function
implemented in R and following a simple format can be used for
spatial prediction. There are also many useful functions for plotting
and working with spatial data as images. This package also contains
an implementation of sparse matrix methods for large spatial data
sets and currently requires the sparse matrix (spam) package. Use
help(fields) to get started and for an overview. The fields source
code is deliberately commented and provides useful explanations of
numerical details as a companion to the manual pages. The commented
source code can be viewed by expanding the source code version
and looking in the R subdirectory. The reference for fields can be generated
by the citation function in R and has DOI <doi:10.5065/D6W957CT>. Development
of this package was supported in part by the National Science Foundation Grant
1417857, the National Center for Atmospheric Research, and Colorado School of Mines.
See the Fields URL
for a vignette on using this package and some background on spatial statistics.
License: GPL (>= 2)
URL: https://github.com/NCAR/Fields
Depends: R (>= 3.0), methods, spam, viridis
Imports: maps
NeedsCompilation: yes
Repository: CRAN
Packaged: 2021-05-06 20:45:03 UTC; nychka
Author: Douglas Nychka [aut, cre],
Reinhard Furrer [aut],
John Paige [aut],
Stephan Sain [aut],
Florian Gerber [aut],
Matthew Iverson [aut],
University Corporation for Atmospheric Research [cph]
12 changes: 12 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/LICENSE.note
@@ -0,0 +1,12 @@
All R code and documentation in this package (fields) is licensed
under the terms of the GPL license.

NOTE:

The sparse matrix methods used in fields are supported by the package
spam. The spam package contains some FORTRAN routines where some
licensing issues are unclear. Please refer to the spam license
information for details. Note that many functions in fields e.g. Tps,
Krig, all the graphical functions, function indepedently of the spam package so much
of fields will be functional under a GPL license.

71 changes: 71 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/NAMESPACE
@@ -0,0 +1,71 @@
exportPattern("^[^\\.]")

importFrom("grDevices", "chull", "col2rgb", "colors", "palette", "rgb",
"trans3d")
importFrom("graphics", "abline", "arrows", "axis", "box", "boxplot",
"contour", "hist", "lines", "locator", "matlines",
"matplot", "mtext", "pairs", "par", "persp", "plot",
"points", "polygon", "rect", "segments", "text", "title")
importFrom("stats", "D", "approx", "coef", "cor", "dist", "fft", "mad",
"median", "optim", "optimize", "predict", "quantile",
"rnorm", "sd", "var","qchisq","pnorm")
importFrom("utils", "object.size")
importFrom("maps","map")
importFrom("viridis","viridis")
importFrom("stats", "qnorm")

S3method("[",spatialDesign)
S3method(coef, Krig)
S3method(fitted, Krig)
S3method(image, plot)
S3method(image, smooth)
S3method(print, Krig)
S3method(print, mKrig)
S3method(print,spatialDesign)
S3method(print,spatialProcess)
S3method(print,sreg)
S3method(print,qsreg)
S3method(print,summary.Krig)
S3method(print,summarySpatialDesign)
S3method(print,mKrigSummary)
S3method(print,spatialProcessSummary)
S3method(print,summary.sreg)
S3method(summary,Krig)
S3method(summary,sreg)
S3method(summary,ncdf)
S3method(summary,qsreg)
S3method(summary,spatialDesign)
S3method(summary,spatialProcess)
S3method(summary,mKrig)
S3method(plot,Krig)
S3method(plot,spatialProcess)
S3method(plot,surface)
S3method(plot,spatialDesign)
S3method(plot,sreg)
S3method(plot,qsreg)
S3method(plot,vgram.matrix)
S3method(plot,vgram)
S3method(surface,Krig)
S3method(surface,mKrig)
S3method(surface,default)
S3method(predict,fastTps)
S3method(predict,interp.surface)
S3method(predict,Krig)
S3method(predict,mKrig)
S3method(predict,qsreg)
S3method(predict,sreg)
S3method(predict,surface)
S3method(predict,surface.default)
S3method(predict,Tps)
S3method(predictSE,Krig)
S3method(predictSE,mKrig)
S3method(predictSurface,default)
S3method(predictSurface,fastTps)
S3method(predictSurface,Krig)
S3method(predictSurface,mKrig)
S3method(predictSurfaceSE,default)
useDynLib(fields,.registration=TRUE)

import("spam", "methods")


72 changes: 72 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/R/BD.R
@@ -0,0 +1,72 @@
# fields is a package for analysis of spatial data written for
# the R software environment .
# Copyright (C) 2018
# University Corporation for Atmospheric Research (UCAR)
# Contact: Douglas Nychka, nychka@ucar.edu,
# National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the R software environment if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# or see http://www.r-project.org/Licenses/GPL-2
"BD" <- structure(list(KCl = c(30, 30, 20, 50, 25,
10, 40, 15, 50, 10, 20, 45, 50, 35, 40, 35, 30, 15, 40, 30,
10, 50, 20, 10, 25, 45, 30, 25, 45, 10, 45, 10, 30, 30, 20,
50, 10, 40, 15, 20, 45, 50, 35, 35, 30, 15, 30, 10, 50, 20,
25, 45, 30, 25, 45, 10, 45, 10, 30, 30, 25, 50, 10, 40, 40,
15, 35, 15, 10, 40, 10, 25, 35, 35, 30, 25, 45, 50, 40, 20,
50, 30, 15, 10, 50, 15, 25, 45, 40), MgCl2 = c(5, 5, 4, 7,
7, 4, 4, 6, 6, 7, 4, 7, 5, 6, 5, 7, 7, 6, 3, 4, 4, 4, 3,
3, 3, 4, 6, 3, 6, 5, 3, 6, 5, 5, 4, 7, 4, 4, 6, 4, 7, 5,
6, 7, 7, 6, 4, 4, 4, 3, 3, 4, 6, 3, 6, 5, 3, 6, 5, 5, 7,
6, 7, 5, 3, 6, 3, 5, 6, 6, 7, 7, 7, 5, 4, 6, 5, 6, 3, 7,
7, 4, 3, 4, 3, 3, 4, 4, 7), KPO4 = c(25, 25, 20, 20, 30,
25, 20, 45, 35, 25, 40, 30, 45, 20, 40, 45, 40, 25, 35, 45,
30, 40, 30, 20, 45, 30, 30, 35, 20, 40, 40, 35, 25, 25, 20,
20, 25, 20, 45, 40, 30, 45, 20, 45, 40, 25, 45, 30, 40, 30,
45, 30, 30, 35, 20, 40, 40, 35, 25, 25, 30, 35, 25, 40, 35,
40, 25, 20, 45, 25, 20, 35, 40, 30, 35, 40, 35, 30, 45, 40,
25, 20, 30, 45, 40, 30, 25, 25, 25), dNTP = c(625, 625, 1500,
250, 1500, 1250, 1250, 1250, 1500, 1250, 250, 1250, 1000,
1000, 1500, 750, 1000, 250, 250, 1500, 1000, 750, 750, 500,
500, 500, 250, 1000, 500, 500, 1250, 750, 625, 625, 1500,
250, 1250, 1250, 1250, 250, 1250, 1000, 1000, 750, 1000,
250, 1500, 1000, 750, 750, 500, 500, 250, 1000, 500, 500,
1250, 750, 625, 625, 1500, 1500, 1250, 1500, 250, 1500, 1500,
750, 250, 1500, 750, 1250, 500, 1250, 1250, 1000, 250, 500,
1000, 750, 1000, 250, 500, 1250, 750, 1000, 500, 750, 500),
lnya = c(12.904207, 12.672946, 9.172639, 9.86786, 9.87817,
6.423247, 6.131226, 6.011267, 8.44247, 12.072541, 11.252859,
9.088173, 10.089967, 13.946539, 8.985946, 9.197255, 9.786954,
6.398595, 8.051978, 4.969813, 5.609472, 4.94876, 5.874931,
6.50279, 6.811244, 9.69892, 10.348173, 8.101678, 11.703546,
13.745088, 8.830543, 11.643954, 13.034624, 12.479909,
8.166216, 9.711116, 8.665613, 7.659171, 7.992945, 11.140411,
9.588777, 8.074026, 13.478638, 10.410305, 10.817776,
7.575585, 7.021084, 7.912057, 6.44254, 6.042633, 7.130899,
9.680344, 8.318742, 7.654443, 9.595603, 12.456831, 8.064636,
11.060369, 12.128111, 13.191889, 9.268609, 8.273847,
12.441145, 8.958025, 8.538955, 7.886081, 8.422883, 8.565983,
11.342137, 8.457443, 8.38936, 10.606585, 11.3679, 8.665613,
8.773385, 9.384294, 9.78132, 12.25009, 9.510445, 13.311329,
11.14331, 9.441452, 9.056023, 8.846497, 8.76873, 9.130214,
12.657148, 9.239899, 10.210972)), .Names = c("KCl", "MgCl2",
"KPO4", "dNTP", "lnya"), class = "data.frame", row.names = c("1",
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
"13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31", "32",
"33", "34", "35", "36", "38", "39", "40", "43", "44", "45",
"46", "48", "49", "50", "52", "53", "54", "55", "57", "58",
"59", "60", "61", "62", "63", "64", "65", "66", "67", "68",
"69", "70", "71", "72", "73", "75", "76", "77", "78", "79",
"80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
"90", "91", "92", "93", "94", "95", "96"))
57 changes: 57 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/R/ChicagoO3.R
@@ -0,0 +1,57 @@
# fields is a package for analysis of spatial data written for
# the R software environment .
# Copyright (C) 2018
# University Corporation for Atmospheric Research (UCAR)
# Contact: Douglas Nychka, nychka@ucar.edu,
# National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the R software environment if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# or see http://www.r-project.org/Licenses/GPL-2
"ChicagoO3" <- structure(list(x = structure(c(10.2420950223404,
3.80376523711237, 9.10894898014071, 9.62401536295848, -2.42853799498812,
-12.626852374789, -0.419779101996896, -7.88824165286121,
3.54623204570348, -16.9019033521803, -27.2032310085453, -6.18852258956094,
-5.26140310048807, -12.2147992685346, -25.5550185835271,
-15.6657440334172, 21.109995699806, 12.9204402129956, 33.8836419936979,
28.1148985061338, -8.81404505952784, 6.475624941694, -12.2040623901154,
-18.5689928883614, 6.8907291046231, -14.9714234763093, -2.03401039835273,
10.6958505981398, 12.287083222701, -4.939739538856, 11.4568748968428,
20.2432463455088, 35.0486281566463, 28.0610414140067, 23.2873435403219,
-20.2294095400778, -19.6759373228389, -16.9777602637997,
-17.5312324810386, -18.4998088612067), .Dim = as.integer(c(20,
2)), .Dimnames = list(c("170310032", "170310037", "170310050",
"170311002", "170311003", "170311601", "170314002", "170314003",
"170317002", "170436001", "170890005", "170970001", "170971002",
"170973001", "171110001", "171971008", "180891016", "180892008",
"181270020", "181270024"), c("East.West", "North.South"))),
y = c(36.4902936963152, 34.6396930821552, 31.6444005657229,
34.4646956838262, 37.7204739668803, 40.1342965426748,
37.0181086910068, 38.4001686365134, 44.0485589002946,
38.4870329290307, 42.2402282830657, 40.0049235817847,
42.1090485712195, 39.6319596353327, 42.8054712629932,
44.1097465187358, 35.1186331327201, 46.898470931915,
42.9564231070325, 46.6868555984414), lon.lat = structure(c(-87.546,
-87.671, -87.568, -87.558, -87.792, -87.99, -87.753,
-87.898, -87.676, -88.073, -88.273, -87.865, -87.847,
-87.982, -88.241, -88.049, -87.335, -87.494, -87.087,
-87.199, 41.757, 41.978, 41.708, 41.616, 41.984, 41.668,
41.855, 42.039, 42.062, 41.813, 42.05, 42.177, 42.391,
42.29, 42.221, 41.592, 41.6, 41.639, 41.631, 41.617),
.Dim = as.integer(c(20, 2)), .Dimnames = list(c("170310032",
"170310037", "170310050", "170311002", "170311003",
"170311601", "170314002", "170314003", "170317002",
"170436001", "170890005", "170970001", "170971002",
"170973001", "171110001", "171971008", "180891016",
"180892008", "181270020", "181270024"), c("lon",
"lat")))), .Names = c("x", "y", "lon.lat"))
37 changes: 37 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/R/Exponential.R
@@ -0,0 +1,37 @@
# fields is a package for analysis of spatial data written for
# the R software environment .
# Copyright (C) 2018
# University Corporation for Atmospheric Research (UCAR)
# Contact: Douglas Nychka, nychka@ucar.edu,
# National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the R software environment if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# or see http://www.r-project.org/Licenses/GPL-2
"Exponential" <- function(d, range = 1, alpha = 1/range, phi = 1.0) {
#
# Matern covariance function transcribed from Stein's book page 31
# nu==smoothness==.5, alpha == 1/range
#
# GeoR parameters map to kappa==smoothness and phi == range
# to make old code from Fuentes and also the package SEHmodel
# phi is accepted as the marginal variance of the process (see below)
# within fields this parameter is "sigma"

#
# check for negative distances
if (any(d < 0))
stop("distance argument must be nonnegative")
#
return(phi*exp(-d * alpha))
}
34 changes: 34 additions & 0 deletions fields.Rcheck/00_pkg_src/fields/R/ExponentialUpper.R
@@ -0,0 +1,34 @@
# fields is a package for analysis of spatial data written for
# the R software environment .
# Copyright (C) 2018
# University Corporation for Atmospheric Research (UCAR)
# Contact: Douglas Nychka, nychka@ucar.edu,
# National Center for Atmospheric Research, PO Box 3000, Boulder, CO 80307-3000
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the R software environment if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# or see http://www.r-project.org/Licenses/GPL-2
ExponentialUpper = function(distMat, range = 1, alpha = 1/range) {
# Evaluates the exponential covariance function over the upper triangle of the distance matrix

if(nrow(distMat) != ncol(distMat))
stop('distance matrix is non-symmetric. Should not be calling ExponentialUpper.')

return(.Call("ExponentialUpperC", as.double(distMat), as.integer(nrow(distMat)), as.double(alpha), PACKAGE = "fields"))

#convert ans to standard matrix
#ans = ans[[1]]
#dim(ans) = dim(distMat)

#return(ans)
}

0 comments on commit 27d6ddf

Please sign in to comment.