| Title: | A Bi-Dimensional Implementation of the Empirical Mode Decomposition for Spatial Data | 
| Version: | 0.1-1 | 
| Description: | This implementation of the Empirical Mode Decomposition (EMD) works in 2 dimensions simultaneously, and can be applied on spatial data. It can handle both gridded or un-gridded datasets. | 
| URL: | https://github.com/pierreroudier/spemd | 
| BugReports: | https://github.com/pierreroudier/spemd/issues | 
| Depends: | R (≥ 3.2.3) | 
| License: | GPL-3 | 
| LazyData: | true | 
| Collate: | 'create_neig.r' 'extract_extrema.r' 'extrema_irr.r' 'mean_enveloppe.r' 'spemd.r' | 
| Imports: | sp, spdep, MBA | 
| Suggests: | gstat | 
| RoxygenNote: | 6.0.1 | 
| NeedsCompilation: | no | 
| Packaged: | 2018-06-27 21:50:04 UTC; pierre | 
| Author: | Pierre Roudier [aut, cre] | 
| Maintainer: | Pierre Roudier <pierre.roudier@gmail.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2018-07-01 14:40:03 UTC | 
create.neig
Description
Internal function, initiates the neighbourhood relationships between the points in the processed data set.
Usage
create.neig(data.set, nb.nn = 4, duplicate = "remove", verbose = FALSE)
Arguments
data.set | 
 Data set to create neighbourhood from.  | 
nb.nn | 
 Number of nearest neighbours. Defaults to 4.  | 
duplicate | 
 Ignored.  | 
verbose | 
 Prints progress information messages. Defaults to FALSE.  | 
Author(s)
Pierre Roudier
extract.extrema
Description
Internal function, explicitely returns a list with the tri objects of the extrema.
Usage
extract.extrema(tri.obj, n.extrema.min = 1)
Arguments
tri.obj | 
 .  | 
n.extrema.min | 
 .  | 
Author(s)
Pierre Roudier
extrema.irr
Description
Internal function, finds regional extrema on a irregularly sampled data set
Usage
extrema.irr(data.set, gridded.data, neig = NULL, zcol = "z",
  duplicate = "remove", nb.nn = 4, thresh.extrema = 1, verbose = FALSE)
Arguments
data.set | 
 .  | 
gridded.data | 
 .  | 
neig | 
 Neighbourhood object.  | 
zcol | 
 Name of the column containing the data.  | 
duplicate | 
 What to do with duplicates. Defaults to 'remove'.  | 
nb.nn | 
 Number of nearest neighbours to take into account if data is on a grid. Defaults to 4.  | 
thresh.extrema | 
 Significative threshold for the extrema. Defaults to 1.  | 
verbose | 
 Prints progress information messages. Defaults to FALSE.  | 
Author(s)
Pierre Roudier
return.mean.enveloppe
Description
Internal function, returns the mean enveloppe of a spatial dataset.
Usage
return.mean.enveloppe(extrema, data, zcol = "z", method = "splines",
  n.pts.spline = 3, verbose = TRUE)
Arguments
extrema | 
 .  | 
data | 
 .  | 
zcol | 
 Name of the column containing the data.  | 
method | 
 Interpolation method. Currently only 'splines' is supported.  | 
n.pts.spline | 
 .  | 
verbose | 
 Prints progress information messages. Defaults to TRUE.  | 
Author(s)
Pierre Roudier
spEMD
Description
2D EMD for spatial objects
Usage
spEMD(data, zcol = "z", method = "splines", n.imf.max = 10,
  n.sp.max = 5, n.extrema.min = 1, stoprule = "mean.imf",
  stoprule.extrema = TRUE, thresh.extrema = 1, tol = 0,
  diff.nb.extrema = 0.05, abs.nb.extrema = 5, nb.nn = 4,
  n.pts.spline = 4, neig = NULL, save_neig = TRUE, verbose = TRUE)
Arguments
data | 
 Input dataset, either a 'data.frame' or a 'Spatial*DataFrame'  | 
zcol | 
 Name of the column containing the attribute of interest.  | 
method | 
 Interpolation method. Currently only 'splines' is supported.  | 
n.imf.max | 
 Maximum depth of decomposition (maximum number of IMF).  | 
n.sp.max | 
 Number of iterations in the sifting process.  | 
n.extrema.min | 
 Minimum number of extrema.  | 
stoprule | 
 Rule used to stop the EMD process. Currently only 'mean.imf' is implemented.  | 
stoprule.extrema | 
 Should 'spEMD' checks for the number of extrema to be similar? Defaults to 'TRUE'.  | 
thresh.extrema | 
 Significative threshold for the extrema. Defaults to 1.  | 
tol | 
 Value that the avergae of the IMF candidate need to reach so to be considered as a valid IMF.  | 
diff.nb.extrema | 
 Percentage limit difference maxima/minima. If smaller, more permissive on the mean of the IMF candidate.  | 
abs.nb.extrema | 
 Absolute difference between number of extrema.  | 
nb.nn | 
 Number of nearest neighbours to take into account (when data is on a regular grid).  | 
n.pts.spline | 
 Number of points to locally interpolate IMFs.  | 
neig | 
 Option the re-use a formerly existing neig object in order to save time.  | 
save_neig | 
 Option to save the neig object as a .RData file once created.  | 
verbose | 
 Prints progress information messages. Defaults to TRUE.  | 
Value
.
Author(s)
Pierre Roudier
Examples
# Getting sample data from the gstat package
if (require(gstat)) {
library(sp)
# Example for gridded data
data(ncp.grid, package = 'gstat')
coordinates(ncp.grid) <- ~x+y
gridded(ncp.grid) <- TRUE
res.ncp <- spEMD(ncp.grid, zcol = "depth", thresh.extrema = 0.1, verbose = FALSE)
# Plot results
spplot(res.ncp[, c('imf1', "imf2", "imf3")])
}
#