diff --git a/.Rbuildignore b/.Rbuildignore
deleted file mode 100644
index 91114bf2f2bba5e0c5252e75018da19b869776f1..0000000000000000000000000000000000000000
--- a/.Rbuildignore
+++ /dev/null
@@ -1,2 +0,0 @@
-^.*\.Rproj$
-^\.Rproj\.user$
diff --git a/.gitignore b/.gitignore
index 5b6a0652566d10360493952aec6d4a4febc77083..25a95ff70b21f3cd5e5ba008179faf596d97dcd4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,10 @@
 .Rproj.user
 .Rhistory
 .RData
+.Rbuildignore
 .Ruserdata
+lidaRtRee.Rproj
+lidaRtRee.Rcheck/
+lidaRtRee_*
+*~
+..Rcheck/
\ No newline at end of file
diff --git a/R/common.R b/R/common.R
index fb5f1d59a2e6c8411b9c959496166afd50ce9c4a..30902e39d2eccc697711e868607c34e35759cdbc 100644
--- a/R/common.R
+++ b/R/common.R
@@ -233,7 +233,7 @@ speciesColor <- function()
              c("Pinus mugo","salmon2", "C"),
              c("Pinus nigra","salmon1", "C"),
              c("Pinus sp.","salmon1", "C"),
-             c("Pinus uncinata","salmon1", "C"),
+             c("Pinus uncinata","salmon4", "C"),
              c("Pinus sylvestris","salmon", "C"),
              c("Populus alba","slateblue", "B"),
              c("Populus nigra","slateblue", "B"),
diff --git a/R/coregistration.R b/R/coregistration.R
index de58d61129c6cb0c60fe2eb629b7242cef966922..163d35167ed9fc5a9e086e9708956bac2fcdf116 100644
--- a/R/coregistration.R
+++ b/R/coregistration.R
@@ -375,7 +375,7 @@ coregistration <- function(chm, trees, mask= NULL, buffer=19, step=0.5, dm=2, pl
     # display initial tree positions
     graphics::points(trees[,1], trees[,2], cex=trees[,3]/40)
     # display coregistered tree positions
-    graphics::points(trees[,1]+resul$dx1, trees[,2]+resul$dy1, cex=trees[,3]/20, col="red")
+    graphics::points(trees[,1]+resul$dx1, trees[,2]+resul$dy1, cex=trees[,3]/40, col="red")
     graphics::legend("topleft", c("Initial", "Coregistered"), pch=1, col=c("black", "red"))
   }
   list(correlation.raster=r.correlation, local.max=resul)
diff --git a/R/tree.metrics.R b/R/tree.metrics.R
new file mode 100644
index 0000000000000000000000000000000000000000..7ad4aa703bd00a37eb718ddf02d25ce640b5991b
--- /dev/null
+++ b/R/tree.metrics.R
@@ -0,0 +1,54 @@
+#' # package lidaRtRee
+#' # Copyright Irstea
+#' # Author(s): Jean-Matthieu Monnet
+#' # Licence: LGPL-3
+#' ###################### FUNCTIONS FOR TREE-LEVEL METRICS COMPUTATION #################
+#' #
+#' ##############################
+#' #' segment-wise computation of point metrics
+#' #'
+#' #' @param p A dataframe with point attributes, including the segment ID field
+#' #' @param columnId A string: name of the field containing the segment ID
+#' #' @param FUN Function to compute for each segment ID. Default: number of points
+#' #' @return A vector of values obtainted by applying the function to the point cloud in each segment
+#' #' @export
+#' computeMetric <- function(p,columnId,FUN=nrow)
+#' {
+#'   by(p,as.factor(p[,columnId]),FUN)
+#' }
+#' ##############################
+#' #' replace values in a raster based on segment ID and tree attributes
+#' #'
+#' #' @param r.dem.w a raster with segment ID, integers starting from 0 to max(r.dem.w)
+#' #' @param segms A dataframe with tree attributes
+#' #' @param attr the attribute to use for rast
+#' #' @return a raster
+#' #' @export
+#' rasterValueFromSegment <- function(r.dem.w, segms, attr)
+#' {
+#'   dummy <- r.dem.w
+#'   # creer le tableau de correspondance id / attribut
+#'   # tableau avec autant de lignes que de segments 'max + 1' en comptant le 0
+#'   fh <- matrix(nrow=max(raster::values(r.dem.w))+1,ncol=1)
+#'   # mettre la hauteur correspondant aux id
+#'   fh[segms$id+1] <- segms[,attr]
+#'   # convertir id en h dans segmentation
+#'   raster::values(dummy) <- as.vector(fh[raster::values(dummy)+1])
+#'   dummy
+#' }
+#' ###############################
+#' #' add trunk altitude information
+#' #'
+#' #' @param segms a data.frame of segment id
+#' #' @param dtm a raster with terrain altitude
+#' #' @param p a point cloud data.frame
+#' #' @return a list with two elements: the segments with additional attribute (terrain altitude in the cell below the maximum) and the point cloud with additional attribute (point height relatively to terrain altitude below maximum)
+#' #' @export
+#' pointHeightAboveTrunk <- function(segms, dtm, p)
+#' {
+#'   # extract terrain altitude
+#'   segms$alt.dtm <- pointsInSegments(segms[,c("x","y")],dtm)
+#'   dummy <- merge(p,segms[,c("id","alt.dtm")],by.x="seg.id",by.y="id",all.x=T)
+#'   dummy$h.trunk <- dummy$z-dummy$alt.dtm
+#'   list(segms,dummy)
+#' }
\ No newline at end of file
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/DESCRIPTION b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/DESCRIPTION
deleted file mode 100644
index 3932dd7e959130064d18904c4db79d9a5b706c40..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/DESCRIPTION
+++ /dev/null
@@ -1,16 +0,0 @@
-Package: lidaRtRee
-Version: 1.0
-Title: Forest Analysis with Airborne Laser Scanning (Lidar) Data
-Date: 2018-04-27
-Author: Jean-Matthieu Monnet [aut, cre]
-Maintainer: Jean-Matthieu Monnet <jean-matthieu.monnet@irstea.fr>
-Description: Provides functions for forest analysis using airborne laser scanning data. It includes complementary steps for foret mapping: extraction of both physical and statistical features from lidar data, model calibration with ground reference, and maps export. 
-URL: https://gitlab.irstea.fr/jean-matthieu.monnet/lidaRtRee
-Imports: graphics, stats, grDevices, sp, raster, imager, akima, leaps,
-        gvlma, car, foreach, doParallel, reldist, lidR (>= 1.4-2)
-License: LGPL-3
-LazyData: TRUE
-RoxygenNote: 6.0.1
-NeedsCompilation: no
-Packaged: 2018-04-27 11:56:04 UTC; jean-matthieu
-Depends: R (>= 2.10)
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/NAMESPACE b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/NAMESPACE
deleted file mode 100644
index 58820f9e280814f2752c5a1406665e5b155aed34..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/NAMESPACE
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by roxygen2: do not edit by hand
-
-export(circle2Raster)
-export(coregistration)
-export(createDisk)
-export(demFiltering)
-export(heightRegression)
-export(histDetection)
-export(histStack)
-export(maximaDetection)
-export(maximaSelection)
-export(plot2Dmatched)
-export(plotTreeInventory)
-export(points2DSM)
-export(points2DTM)
-export(polar2Projected)
-export(rasterChullMask)
-export(rasterLocalmax)
-export(rasterXYMask)
-export(rasters2Cor)
-export(rastersMovingCor)
-export(segAdjust)
-export(segmentation)
-export(speciesColor)
-export(treeExtraction)
-export(treeMatching)
-export(treeSegmentation)
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/chmchablais3-data.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/chmchablais3-data.R
deleted file mode 100644
index 5b78972dafe4b131956b8c54fbc510f860f7790c..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/chmchablais3-data.R
+++ /dev/null
@@ -1,23 +0,0 @@
-#' @name chmchablais3
-#' 
-#' @title Canopy height model (Chablais 3 plot)
-#' 
-#' @description Canopy height model computed from airborne laser scanning data acquired in July 2010.
-#' 
-#' @docType data
-#'
-#' @usage data(chmchablais3)
-#'
-#' @format A raster object
-#'
-#' @keywords datasets
-#'
-#' @references Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22 & 34 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-#'
-#' @examples
-#' data(chmchablais3)
-#' chmchablais3
-#' \dontrun{
-#' raster::plot(chmchablais3)}
-NULL
-"chmchablais3"
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/common.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/common.R
deleted file mode 100644
index a06de7ecaed9236f3fd4380125494251375da7f2..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/common.R
+++ /dev/null
@@ -1,426 +0,0 @@
-# package lidaRtRee
-# Copyright Irstea
-# Author(s): Jean-Matthieu Monnet
-# Licence: LGPL-3
-################################
-#' Digital Surface Model
-#' 
-#' Creates a Digital Surface Model from LAS object. Raster extent is specified by the coordinates of lower left and upper right corners. Default extent covers the full range of points, and aligns on multiple values of the resolution. Cell value is the maximum height of points contained in the cell.
-#'
-#' @param .las LAS object (e.g. from \code{\link[lidR]{LAS}} function)
-#' @param res numeric. raster resolution
-#' @param xmin numeric. lower left corner easting coordinate for output raster.
-#' @param xmax numeric. upper right corner easting coordinate for output raster.
-#' @param ymin numeric. lower left corner northing coordinate for output raster.
-#' @param ymax numeric. upper right corner northing coordinate for output raster.
-#' @return A raster object.
-#' @seealso \code{\link{points2DTM}} for Digital Terrain Model computation.
-#' @examples
-#' data(laschablais3)
-#' 
-#' # create digital surface model with first-return points, resolution 0.5 m
-#' dsm <- points2DSM(lidR::lasfilterfirst(laschablais3), res=0.5)
-#' 
-#' \dontrun{
-#' # display raster
-#' raster::plot(dsm,asp=1)}
-#' @export
-points2DSM <- function(.las, res=1, xmin, xmax, ymin, ymax)
-{
-  #
-  if (missing(xmin) | missing(xmax) | missing(ymin) | missing(ymax)) # if no extent info
-  {
-    xmin <- floor(min(.las@data$X)/res)*res
-    xmax <- ceiling(max(.las@data$X)/res)*res
-    ymin <- floor(min(.las@data$Y)/res)*res
-    ymax <- ceiling(max(.las@data$Y)/res)*res
-  }
-  # create empty raster
-  r <- raster::raster()
-  raster::extent(r) <- c(xmin,xmax,ymin,ymax)
-  raster::res(r) <- res
-  raster::crs(r) <- NA
-  # convert LAS coordinates to spatial data
-  points <- as.data.frame(.las@data[,1:2])
-  val <- .las@data[,3]
-  sp::coordinates(points)=c(1,2)
-  # rasterize with max function
-  raster::rasterize(points,r,val,fun=max)
-}
-###################################
-#' Digital Terrain Model
-#' 
-#' Creates a Digital Terrain Model from LAS object. Raster extent is specified by the coordinates of lower left and upper right corners. Default extent covers the full range of points, and aligns on multiple values of the resolution. Cell value is compute as the Delaunay interpolation at the cell center. Relies on the \code{\link[akima]{interp}} function, which is slow, while waiting for new release of \code{\link[lidR]{grid_terrain}} which will integrate an additional argument to specify the output extent.
-#'
-#' @param .las LAS object (e.g. from \code{\link[lidR]{LAS}} function) containing only ground points
-#' @param res numeric. raster resolution
-#' @param xmin numeric. lower left corner easting coordinate for output raster.
-#' @param xmax numeric. upper right corner easting coordinate for output raster.
-#' @param ymin numeric. lower left corner northing coordinate for output raster.
-#' @param ymax numeric. upper right corner northing coordinate for output raster.
-#' @seealso \code{\link{points2DSM}} for Digital Surface Model computation.
-#' @return A raster object
-#' @examples
-#' data(laschablais3)
-#' 
-#' # create digital terrain model with points classified as ground
-#' dtm <- points2DTM(lidR::lasfilter(laschablais3, Classification==2))
-#' 
-#' \dontrun{
-#' # display raster
-#' raster::plot(dtm,asp=1)}
-#' @export
-points2DTM = function(.las, res = 1, xmin, xmax, ymin, ymax)
-{
-  if (missing(xmin) | missing(xmax) | missing(ymin) | missing(ymax)) # if no extent info
-  {
-    xmin <- floor(min(.las@data$X)/res)*res
-    xmax <- ceiling(max(.las@data$X)/res)*res
-    ymin <- floor(min(.las@data$Y)/res)*res
-    ymax <- ceiling(max(.las@data$Y)/res)*res
-  }
-    points <- as.matrix(.las@data[,c("X","Y","Z")])
-    # interpolation: value estimated at pixel center by bilinear interpolation
-    mnt <- akima::interp(points[,1],points[,2],points[,3], xo=seq(xmin+res/2, xmax-res/2,by=res), yo=seq(ymax-res/2,ymin+res/2,by=-res),linear=TRUE,extrap=FALSE, duplicate="user", dupfun=function(x){min(x)})
-    #
-  dtm = raster::raster(t(mnt[[3]]), xmn = xmin, xmx = xmax, ymn = ymin, ymx = ymax)
-  return(dtm)
-}
-# ################################
-# #' creates Digital Elevation Model from LAS object and extent info (parallelised version)
-# #' tiles extent and calls points2DTM or points2DSM
-# #'
-# #' @param .las LAS object (from \code{lidR} package)
-# #' @param type model to return ("dsm" or "dtm")
-# #' @param res the raster resolution
-# #' @param xmin the raster lower left corner easting coordinate
-# #' @param xmax the raster upper right corner easting coordinate
-# #' @param ymin the raster lower left corner northing coordinate
-# #' @param ymax the raster upper right corner northing coordinate
-# #' @param method a string specifying the interpolation method
-# #' @param buffer the size of buffer area for tiling
-# #' @param tile.size the size of tiles for parallelisation
-# #' @param n.cores the number of cores to use
-# #' @return a raster object
-# #' @export
-# points2DEM = function(.las, type="dtm", res = 1, xmin, xmax, ymin, ymax, method="delaunay", buffer=5, tile.size=250, n.cores=4)
-# {
-#   doParallel::registerDoParallel(cores=n.cores)
-#   if (missing(xmin) | missing(xmax) | missing(ymin) | missing(ymax)) # if no extent info
-#   {
-#     xmin <- floor(min(.las@data$X)/res)*res
-#     xmax <- ceiling(max(.las@data$X)/res)*res
-#     ymin <- floor(min(.las@data$Y)/res)*res
-#     ymax <- ceiling(max(.las@data$Y)/res)*res
-#   }
-#   # low left corner
-#   xlow <- floor(xmin/tile.size)*tile.size
-#   ylow <- floor(ymin/tile.size)*tile.size
-#   # tiles indices which intersect the extent
-#   i <- 0
-#   j <- 0
-#   n <- 1
-#   l <- list()
-#   while(xlow+i*tile.size<xmax)
-#   {
-#     while(ylow + j * tile.size < ymax)
-#     {
-#       l[[n]] <- c(i,j)
-#       n <- n+1
-#       j <- j+1
-#     }
-#     i <- i+1
-#     j <- 0
-#   }
-#   l <- foreach::foreach(i=1:length(l), .errorhandling="remove") %dopar%
-#   {
-#     coord <- c(max(xmin, xlow+l[[i]][1]*tile.size), min(xmax, xlow+(l[[i]][1]+1)*tile.size), max(ymin, ylow+l[[i]][2]*tile.size), min(ymax, ylow+(l[[i]][2]+1)*tile.size))
-#     dummy <- .las %>% lidR::lasfilter(X >= coord[1]-buffer & X <= coord[2]+buffer & Y >= coord[3]-buffer & Y <= coord[4]+buffer)
-#     if (type=="dtm") {return(points2DTM(dummy, res = res, coord[1], coord[2], coord[3], coord[4], method=method))}
-#     else {return(points2DSM(dummy, res = res, coord[1], coord[2], coord[3], coord[4]))}
-#   }
-#   l$fun <- mean
-#   l$na.rm <- TRUE
-#   do.call(raster::mosaic, l)
-# }
-################################
-#' Polar to cartesian coordinates conversion
-#' 
-#' Computes projected coordinates (Easting, Northing, Altitude) from polar coordinates (Azimuth, Slope, Distance) and center position (Easting, Northing, Altitude). Magnetic declination and meridian convergence are optional parameters. In case distance is measured to the border of objects (e.g. trees), the diameter can be added to compute the coordinates of object center.
-#'
-#' @param x vector. easting coordinates of centers in meter
-#' @param y vector. northing coordinates of centers in meter
-#' @param z vector. altitudes of centers in meters
-#' @param declination vector. magnetic declination values in radian
-#' @param convergence vector. meridian convergence values in radian
-#' @param azimuth vector. azimuth values from centers in radian
-#' @param slope vector. slope values from centers in radian
-#' @param dist vector. distances between centers and objects in meter
-#' @param diameter vector. diameters in meter (e.g. in case a radius should be added to the distance)
-#' @seealso \code{\link{plotTreeInventory}} for tree inventory display
-#' @return A data.frame with easting, northing and altitude coordinates, and horizontal distance from centers to objects centers
-#' @examples
-#' # create data.frame of trees with polar coordinates and diameters
-#' trees <- data.frame (x=rep(c(0,10), each=2),
-#'  y = rep(c(0,10),each=2),
-#'  z=rep(c(0,2),each=2),
-#'  azimuth=rep(c(0,pi/3)),
-#'  dist=rep(c(2,4)),
-#'  slope=rep(c(0,pi/6)),
-#'  diameter.cm=c(15,20,25,30))
-#' trees
-#'  
-#'  # compute projected coordinates
-#' polar2Projected(trees$x, trees$y, trees$z, trees$azimuth, trees$dist,
-#'  trees$slope, declination=0.03, convergence=0.02, trees$diameter.cm/200)
-#' @export
-polar2Projected <- function(x, y, z=0, azimuth, dist, slope=0, declination=0, convergence=0, diameter=0)
-{
-  d <- dist*cos(slope)+diameter/2
-  data.frame(x = x + d*sin(azimuth+convergence+declination),
-             y = y + d*cos(azimuth+convergence+declination),
-             z = z + (dist*sin(slope)+diameter/2),
-             d)
-}
-###############################
-#' Table of species names, abreviations and display colors
-#' 
-#' table for species names, abreviations and type (coniferous/broadleaf), and display color
-#' @return A data frame with species name, color, coniferous (C) / broadleaf (B) type, and name abreviation GESP of GEnus and SPecies 
-#' @seealso \code{\link{plotTreeInventory}} for tree inventory display
-#' @examples
-#' # load table
-#' tab.species <- speciesColor()
-#' head(tab.species)
-#' summary(tab.species)
-#' @export
-speciesColor <- function()
-{
-  d <- rbind(c("Abies alba","purple", "C"),
-             c("Acer","orange", "B"),
-             c("Acer campestre","orange1", "B"),
-             c("Acer opalus","orange2", "B"),
-             c("Acer platanoides","orange3", "B"),
-             c("Acer pseudoplatanus","orange4", "B"),
-             c("Acer sp.","orange", "B"),
-             c("Alnus incana","violet", "B"),
-             c("Alnus viridis","violet", "B"),
-             c("Betula pendula","darkgreen", "B"),
-             c("Betula pubescens","darkgreen", "B"),
-             c("Betula sp.","darkgreen", "B"),
-             c("Buxus sempervirens","black", "B"),
-             c("Carpinus betulus","seagreen", "B"),
-             c("Castanea sativa","pink", "B"),
-             c("Corylus avellana","cadetblue2", "B"),
-             c("Cornus mas","black", "B"),
-             c("Cotinus sp.","black", "B"),
-             c("Crataegus sp.","black", "B"),
-             c("Crataegus monogyna","black", "B"),
-             c("Euonymus latifolius","black", "B"),
-             c("Fagus sylvatica","green", "B"),
-             c("feuillus","black", "B"),
-             c("Fraxinus excelsior","yellow", "B"),
-             c("Ilex aquifolium","cyan", "B"),
-             c("inconnu","black", NA),
-             c("Juniperus communis","black", "C"),
-             c("Juniperus sp.","black", "C"),
-             c("Laburnum anagyroides","black", "B"),
-             c("Larix decidua","pink", "C"),
-             c("Larix kaempferi","pink", "C"),
-             c("Malus sylvestris","plum", "B"),
-             c("Picea abies","blue", "C"),
-             c("Pinus cembro","salmon3", "C"),
-             c("Pinus mugo","salmon2", "C"),
-             c("Pinus nigra","salmon1", "C"),
-             c("Pinus sp.","salmon1", "C"),
-             c("Pinus sylvestris","salmon", "C"),
-             c("Populus alba","slateblue", "B"),
-             c("Populus nigra","slateblue", "B"),
-             c("Populus tremula","slateblue", "B"),
-             c("Pseudotsuga menziesii","darkblue", "C"),
-             c("Prunus avium","grey", "B"),
-             c("Prunus sp.","grey", "B"),
-             c("Pyrus communis","grey", "B"),
-             c("Quercus petraea","turquoise", "B"),
-             c("Quercus pubescens","turquoise", "B"),
-             c("Quercus robur","turquoise", "B"),
-             c("Salix caprea","darkgoldenrod2", "B"),
-             c("Salix sp.","darkgoldenrod2", "B"),
-             c("Salix nigra","darkgoldenrod2", "B"),
-             c("Sorbus aria","red3", "B"),
-             c("Sorbus aucuparia","red", "B"),
-             c("Taxus baccata","burlywood3", "C"),
-             c("Tilia cordata","chocolate4", "B"),
-             c("Tilia platyphyllos","chocolate4", "B"),
-             c("Tilia sp.","chocolate4", "B"),
-             c("Ulmus glabra","brown", "B"),
-             c("Ulmus sp.","brown", "B"),
-             c("Viburnum lantana","black", "B"))
-  d <- as.data.frame(d,stringsAsFactors = F)
-  names(d) <- c("name","col","broad.conif")
-  d$broad.conif <- factor(d$broad.conif)
-  # abreviation GEsp (GEnus species)
-  dummy <- strsplit(d$name," ")
-  dummy2 <- lapply(dummy, function(x){
-    ifelse(length(x)==2 && x[2]=="sp.", 
-           paste(toupper(substr(x[1],1,2)),"sp",sep=""),
-           paste(toupper(substr(x,1,2)),collapse=""))})
-  d$abvr <- row.names(d) <- unlist(dummy2)
-  d
-}
-#######################################
-#' Displays a map of tree inventory data
-#' 
-#' displays tree inventory data
-#'
-#' @param xy data.frame. contains two columns with the X, Y  coordinates of tree centers
-#' @param height vector.  tree heights in meters 
-#' @param diam vector. tree diameters in centimeters
-#' @param species vector. species abreviation as in \code{\link{speciesColor}} for display with corresponding color.
-#' @param add boolean. indicates whether points should be added to an existing plot
-#' @seealso \code{\link{speciesColor}} for a table of species and associated colors
-#' @examples
-#' # load tree inventory data from plot Chablais 3
-#' data("treeinventorychablais3")
-#' 
-#' \dontrun{
-#' # display tree inventory
-#' plotTreeInventory(treeinventorychablais3[,c("x","y")],
-#' treeinventorychablais3$h,
-#' species=as.character(treeinventorychablais3$s))}
-#' @return no return
-#' @export
-#'
-plotTreeInventory <-function(xy, height=NULL, diam=NULL, species=NULL, add=FALSE)
-{
-  # set size of symbol
-  # proportionnal to height if present
-  if(!is.null(height))
-  {
-    size <- height/20
-    # otherwise proportionnal to diameter
-  } else {
-    if (!is.null(diam/40))
-    {
-      size <- diam/20
-    } else { size <- 1}
-  }
-  # apply species-specific colors
-  if (!is.null(species))
-  {
-    # load palette
-    color <- speciesColor()
-    # extract corresponding colors
-    col1 <- color[as.character(species), c("col","abvr")]
-  } else { col1 <- data.frame(col="black")}
-  if (add==FALSE)
-  {
-    #grDevices::dev.new(height=2.5,width=2.5)
-    graphics::par(mar=c(2.5,2.5,0.5,0.5))
-    graphics::plot(xy[,1],xy[,2],cex=size,col=col1$col,xlab="NA",ylab="NA",yaxt="n",xaxt="n",asp=1)
-    graphics::axis(2,mgp=c(0.5,0.5,0))
-    graphics::axis(1,mgp=c(0.5,0.5,0))
-    graphics::mtext(side=2,text="Easting (m)",line=1.3)
-    graphics:: mtext(side=1,text="Northing (m)",line=1.3)
-  } else { 
-    graphics::points(xy[,1],xy[,2],cex=size,col=col1$col)
-  }
-  # add color legend
-  if (!is.null(species))
-  {
-    texte <- sort(unique(col1$abvr))
-    graphics::legend("topleft", texte, col=color[texte,"col"],pch=15,cex=1,y.intersp = 1)
-  }
-}
-##################################
-#' Raster mask by union of buffers around xy positions
-#' 
-#' creates a raster mask by union of circular buffers around xy positions
-#'
-#' @param xy 2 columns matrix or data.frame. xy positions
-#' @param buff vector.  buffers to apply to the xy positions
-#' @param r raster object. target raster
-#' @param binary boolean. should the output mask be boolean (TRUE) or greyscale (FALSE)
-#' @return a raster object
-#' @seealso \code{\link{rasterChullMask}}
-#' @examples
-#' # create raster
-#' r <- raster::raster()
-#' raster::extent(r) <- c(0,40,0,40)
-#' raster::res(r) <- 1
-#' 
-#' # xy positions
-#' xy <- data.frame(c(10,20,31.25,15),
-#'   c(10,20,31.25,25))
-#' # compute mask
-#' mask1 <- rasterXYMask(xy, c(5, 8, 5, 5), r)
-#' mask2 <- rasterXYMask(xy, c(5, 8, 5, 5), r, binary=FALSE)
-#' 
-#' \dontrun{
-#' # display binary raster
-#' raster::plot(mask1)
-#' graphics::points(xy)
-#' 
-#' # display distance raster
-#' raster::plot(mask2)
-#' graphics::points(xy)}
-#' @export
-rasterXYMask <- function(xy, buff, r, binary=TRUE)
-{
-  # compute squared buffers
-  buff2 <- buff^2
-  # compute XY coordinates of cell centers
-  dummyXY <- raster::xyFromCell(r,1:length(r))
-  # create matrix of cell values
-  val <- matrix(NA,nrow=length(r), ncol=nrow(xy))
-  # compute cell value for each position
-  for (i in 1:nrow(xy))
-  {
-    val[,i] <- sqrt(pmax(0,buff2[i] - ((dummyXY[,1]-xy[i,1])^2 + (dummyXY[,2]-xy[i,2])^2)))
-  }
-  # take maximum for each cell
-  val <- apply(val,1,max)
-  # convert to binary if required
-  if (binary) {val <- val >0}
-  raster::values(r) <- val
-  r
-}
-####################################
-#' Raster mask of convex hull
-#' 
-#' creates raster mask corresponding to the convex hull of xy positions
-#'
-#' @param xy 2 columns matrix or data.frame. xy positions
-#' @param r raster object. target raster
-#' @return a raster with 0 or 1
-#' @examples
-#' # create raster
-#' r <- raster::raster()
-#' raster::extent(r) <- c(0,40,0,40)
-#' raster::res(r) <- 1
-#' 
-#' # xy positions
-#' xy <- data.frame(c(10,20,31.25,15),
-#'   c(10,20,31.25,25))
-#' # compute mask
-#' mask1 <- rasterChullMask(xy, r)
-#' 
-#' \dontrun{
-#' # display binary raster
-#' raster::plot(mask1)
-#' graphics::points(xy)}
-#' @seealso \code{\link{rasterXYMask}}
-#' @export
-rasterChullMask <- function(xy, r)
-{
-  # points on convexHull
-  idchull <- grDevices::chull(xy)
-  #
-  # create chull polygon
-  Po <- sp::Polygons(list(sp::Polygon(xy[c(idchull,idchull[1]),])),1)
-  sPo <- sp::SpatialPolygons(list(Po),proj4string=r@crs)
-  # rasterize polygon
-  dummy <- raster::rasterize(sPo,r)
-  dummy[is.na(dummy)] <- 0
-  dummy
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/coregistration.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/coregistration.R
deleted file mode 100644
index b6e08234826a129d3db7885f6c110056941a3556..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/coregistration.R
+++ /dev/null
@@ -1,383 +0,0 @@
-# package lidaRtRee
-# Copyright Irstea
-# Author(s): Jean-Matthieu Monnet
-# Licence: LGPL-3
-########################### FUNCTIONS FOR COREGISTRATION #############################
-#
-######################################
-#' Raster corresponding to circle extent
-#' 
-#' Creates an empty raster which extents corresponds to the circle specified by center coordinates, radius and optional buffer size.
-#'
-#' @param X numeric. easting coordinate of plot center in meters
-#' @param Y numeric. northing coordinate of plot center in meters
-#' @param radius numeric. plot radius in meters
-#' @param resolution numeric. raster resolution in meters
-#' @param buffer numeric. buffer to be added to plot radius in meters
-#' @return A raster object
-#' @examples
-#' circle2Raster(100, 100, 20, 1, 5)
-#' @export
-circle2Raster <- function(X, Y, radius, resolution=0.5, buffer=0.5)
-{
-  r <- raster::raster()
-  r@extent@xmin <- floor((X-radius-buffer)/resolution)*resolution
-  r@extent@ymin <- floor((Y-radius-buffer)/resolution)*resolution
-  r@extent@xmax <- ceiling((X+radius+buffer)/resolution)*resolution
-  r@extent@ymax <- ceiling((Y+radius+buffer)/resolution)*resolution
-  raster::res(r) <- resolution
-  raster::crs(r) <- NA
-  r
-}
-######################################
-#' Correlation between two rasters
-#' 
-#' computes correlation between two rasters, based on the extent of the smallest one.
-#'
-#' @param raster.b raster. raster to correlate with largest extent
-#' @param raster.s raster. raster to correlate with smallest extent
-#' @param mask raster. mask of area to correlate
-#' @param small.SC boolean. is the small raster already standardized and centered ?
-#' @seealso \code{\link{rastersMovingCor}} to compute correlation between rasters for different translations
-#' @return A numeric
-#' @examples
-#' # create raster
-#' r.b <- raster::raster()
-#' raster::extent(r.b) <- c(0,40,0,40)
-#' raster::res(r.b) <- 1
-#' xy <- raster::xyFromCell(r.b,1:length(r.b))
-#' 
-#' # add Gaussian surface and noise
-#' z <- 3*exp(-((xy[,1]-20)^2+(xy[,2]-20)^2/2)/6)
-#' r.b <- raster::rasterFromXYZ(cbind(xy,z))
-#' 
-#' # create circular mask of radius 5
-#' z.mask <- (xy[,1]-20)^2 + (xy[,2]-20)^2 < 5^2
-#' r.mask <- raster::rasterFromXYZ(cbind(xy, z.mask))
-#' 
-#' # create small raster of size 20
-#' r.s <- raster::crop(r.b, raster::extent(c(10,30,10,30)))
-#' 
-#' # add noise to small raster
-#' raster::values(r.s) <- raster::values(r.s) + rnorm(length(r.s),0,0.5)
-#' r.mask <- raster::crop(r.mask, raster::extent(c(10,30,10,30)))
-#'
-#' # compute correlation on masked area where signal to noise ratio is lower
-#' rasters2Cor(r.b, r.s, r.mask, small.SC=FALSE)
-#' 
-#' # compute correlation for whole small raster
-#' rasters2Cor(r.b, r.s, small.SC=FALSE)
-#' 
-#' \dontrun{
-#' # display large raster
-#' raster::plot(r.b, main="Large raster")
-#' # display small raster
-#' raster::plot(r.s, main="Small raster")
-#' # display mask
-#' raster::plot(r.mask, main="Computation mask")}
-#' @export
-rasters2Cor <- function(raster.b, raster.s, mask=NULL, small.SC=TRUE)
-{
-  # crop large raster to smaller size
-  raster.b <- raster::crop(raster.b,raster.s)
-  # apply raster mask if existing
-  if (!is.null(mask))
-  {
-    # apply raster mask to small raster if not already centered / standardized
-    if (small.SC==F) {raster.s <- raster.s*mask}
-    raster.b <- raster.b*mask
-  }
-  # center small raster if not already done
-  if (small.SC==F)
-  {
-    # compute standard deviation
-    sd.raster.s <- stats::sd(raster::values(raster.s),na.rm=TRUE)
-    # compute mean
-    m.raster.s <- mean(raster::values(raster.s),na.rm=TRUE)
-    # center values of small raster
-    raster.s <- raster.s - m.raster.s
-  } else {sd.raster.s <- 1}
-  # compute standard deviation of large raster
-  sd.raster.b <- stats::sd(raster::values(raster.b),na.rm=TRUE)
-  # compute mean of large raster
-  m.raster.b <- mean(raster::values(raster.b),na.rm=TRUE)
-  # center large raster
-  raster.b <- raster.b-m.raster.b
-  #
-  # compute correlation value
-  mean(raster::values(raster.b*raster.s),na.rm=TRUE)/(sd.raster.s*sd.raster.b)
-}
-#
-######################################
-#' Correlation between rasters for different XY translations
-#' 
-#' computes correlation between two rasters for different XY translations. The correlation values are computed on the extent of the smallest raster using \code{\link{rasters2Cor}}, after applying an optional mask, and for each translation within a buffer area.  
-#'
-#' @param raster.b raster. raster to correlate with largest extent
-#' @param raster.s raster. raster to correlate with smallest extent
-#' @param mask raster. mask of area to correlate, applied to small raster
-#' @param buffer numeric. radius of the circular buffer area for possible translations
-#' @param pas numeric. increment step of translations within buffer area to compute correlation values, should be a multiple of raster resolution
-#' @seealso \code{\link{rasterLocalmax}} to extract local maximum of resulting correlation raster, \code{\link{rasters2Cor}}
-#' @return A raster. Raster value at coordinates x,y correspond to the correlation between the large raster and the small raster when small raster center has been translated of (x,y)
-#' @examples
-#' # create raster
-#' r.b <- raster::raster()
-#' raster::extent(r.b) <- c(0,40,0,40)
-#' raster::res(r.b) <- 1
-#' xy <- raster::xyFromCell(r.b,1:length(r.b))
-#' 
-#' # add Gaussian surfaces
-#' z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-#' z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-#' z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-#' r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-#' 
-#' # create small raster
-#' r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-#' # offset raster by (-3, -3)
-#' raster::extent(r.s) <- c(12,22,12,22)
-#'
-#' # compute correlations for translations inside buffer
-#' rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-#' rr
-#' 
-#' \dontrun{
-#' # display large raster
-#' raster::plot(r.b)
-#' # display small raster
-#' raster::plot(r.s)
-#' # display correlation
-#' raster::plot(rr, xlab="X translation", ylab="Y translation",
-#' main="Correlation between rasters")}
-#' @export
-rastersMovingCor <- function(raster.b, raster.s, mask=NULL, buffer=19, pas=0.5)
-{
-  # create data.frame for results
-  resultat <- data.frame(xoffset=numeric(),yoffset=numeric(),correlation=numeric())
-  # initialize output line
-  n <- 0
-  # perform computation on small raster
-  # apply mask
-  if (!is.null(mask))
-  {
-    raster.s <- raster.s*mask
-  }
-  # center and standardize small raster
-  raster.s <- raster.s-mean(raster::values(raster.s),na.rm=T)
-  raster.s <- raster.s/stats::sd(raster::values(raster.s),na.rm=T)
-  #
-  # compute squared radius
-  buff2 <- buffer^2
-  # copy small raster before offsetting
-  matrice2 <- raster.s
-  # copy mask before offsetting
-  if (!is.null(mask)) {mask2 <- mask} else {mask2 <- NULL}
-  # loop on X offset        
-  for (xoffset in seq(from=-buffer,to=buffer,by=pas))
-  {
-    # modify small raster X extent
-    matrice2@extent@xmin <- raster.s@extent@xmin+xoffset
-    matrice2@extent@xmax <- raster.s@extent@xmax+xoffset
-    # modify mask X extent
-    if (!is.null(mask))
-    {
-      mask2@extent@xmin <- mask@extent@xmin+xoffset
-      mask2@extent@xmax <- mask@extent@xmax+xoffset
-    }
-    # loop on Y offset
-    for (yoffset in seq(from=-buffer,to=buffer,by=pas))
-    {
-      # check if new position is inside the search buffer
-      if (yoffset^2+xoffset^2<=buff2)
-      {
-        # modify small raster Y extent
-        matrice2@extent@ymin <- raster.s@extent@ymin+yoffset
-        matrice2@extent@ymax <- raster.s@extent@ymax+yoffset
-        # modify mask Y extent
-        if (!is.null(mask))
-        {
-          mask2@extent@ymin <- mask@extent@ymin+yoffset
-          mask2@extent@ymax <- mask@extent@ymax+yoffset
-        }
-        # increment line
-        n <- n+1
-        # compute correlation and record results
-        resultat[n,] <- c(xoffset, yoffset, rasters2Cor(raster.b,matrice2,mask2,T))
-      }
-    }
-  }
-  # convert results to raster
-  taille <- length(seq(from=-buffer,to=buffer,by=pas))
-  rr <- raster::raster(nrows=taille,ncols=taille,xmx=buffer+pas/2,xmn=-buffer-pas/2,ymx=buffer+pas/2,ymn=-buffer-pas/2)
-  rr <- raster::rasterize(resultat[,1:2],rr,resultat[,3],fun=max)
-  rr
-}
-########################################################
-#' Statistics of raster local maximum
-#' 
-#' identifies local maximum from raster (e.g. output from \code{\link{rastersMovingCor}}), and computes related statistics. The second local maximum is the pixel which is local maximum on the largest neighborhood except for the global maximum.
-#'
-#' @param r raster. typically output of \code{\link{rastersMovingCor}}
-#' @param dm numeric. minimum distance between two local maxima in meters
-#' @param med1 numeric. window radius to compute median value around the maximum position (default: 1m)
-#' @param med2 numeric. window radius #2 to compute median value around the maximum position (default: 2m)
-#' @param quanta numeric. quantile value to compute for raster values (default: 3rd quartile)
-#' @param quantb numeric. quantile #2 value to compute for raster values (default: median)
-#' @seealso \code{\link{rastersMovingCor}}, \code{\link{coregistration}} for application to the coregistration of tree inventory data with canopy height models
-#' @return A data.frame with value of maximum, position of maximum, position of second maximum, ratio of max value to 2nd max, ratio of max value to median of neighborhood (size1 and size 2), ratio of max value to raster quantiles 1 and 2
-#' @examples
-#' # create raster
-#' r.b <- raster::raster()
-#' raster::extent(r.b) <- c(0,40,0,40)
-#' raster::res(r.b) <- 1
-#' xy <- raster::xyFromCell(r.b,1:length(r.b))
-#' 
-#' # add Gaussian surfaces
-#' z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-#' z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-#' z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-#' r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-#' 
-#' # create small raster
-#' r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-#' # offset raster by (-3, -3)
-#' raster::extent(r.s) <- c(12,22,12,22)
-#'
-#' rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-#' loc.max <- rasterLocalmax(rr)
-#' loc.max
-#' 
-#' \dontrun{
-#' # plot raster
-#' raster::plot(rr)
-#' # add location of two local maxima
-#' points(loc.max[1,c("dx1","dx2")], loc.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3)}
-#' @export
-rasterLocalmax <- function(r, dm=2, med1=1, med2=2, quanta=0.75, quantb=0.5)
-{
-  # check if raster is valid
-  if (length(r)>1 && max(raster::values(r),na.rm=T)>-Inf)
-  {
-    # convert raster to cimg object
-    dummy<- imager::as.cimg(raster::as.matrix(r))
-    # replace NA values with -Inf
-    dummy[is.na(dummy)] <- -Inf
-    # maxima detection
-    maxi <- maximaDetection(dummy,raster::res(r)[1])
-    dummy[] <- 1
-    # maxima selection, without value criteria
-    maxi <- maximaSelection(maxi, dummy, hmin=0, dmin=dm, dprop=0)
-    # conversion to raster
-    maxi <- raster::raster(as.matrix(maxi))
-    raster::extent(maxi) <- raster::extent(r)
-    # indice of global max
-    pixel1 <- raster::which.max(maxi)
-    # max value
-    max1 <- r[pixel1[1]]
-    # coordinates of global max
-    coord1 <- raster::xyFromCell(maxi,pixel1[1])
-    # erase first max
-    maxi[pixel1] <- NA
-    # second maximum
-    pixel2 <- raster::which.max(maxi)
-    max2 <- r[pixel2[1]]
-    coord2 <- raster::xyFromCell(maxi,pixel2[1])
-    # median around global max
-    # half resolution
-    hres <- raster::res(r)[1]/2
-    # median around maximum, neighborhood 1
-    medloc1 <- stats::median(raster::values(raster::crop(r,raster::extent(c(coord1[1]-med1-hres, 
-                                                       coord1[1]+med1+hres,
-                                                       coord1[2]-med1-hres,
-                                                       coord1[2]+med1+hres)))), na.rm=T)
-    # median around maximum, neighborhood 2
-    medloc2 <- stats::median(raster::values(raster::crop(r,raster::extent(c(coord1[1]-med2-hres, 
-                                                         coord1[1]+med2+hres,
-                                                         coord1[2]-med2-hres,
-                                                         coord1[2]+med2+hres)))), na.rm=T)
-    # stats of correlation raster
-    quant.a <- stats::quantile(r,quanta,na.rm=T)
-    quant.b <- stats::quantile(r,quantb,na.rm=T)
-    # store results into data.frame
-    data.frame(max1=max1,dx1=coord1[1],dy1=coord1[2],dx2=coord2[1],dy2=coord2[2],ratiomax1max2=max1/max2,rmedloc1=max1/medloc1,rmedloc2=max1/medloc2,rquanta=max1/quant.a,rquantb=max1/quant.b)
-  } else { NA }
-}
-########################################################
-#' Tree inventory and canopy height model coregistration
-#' 
-#' Computes the correlation between the canopy height model and a virtual canopy height model simulated from tree locations, for different translations of tree inventory positions, and outputs the translation corresponding to best estimated co-registration.
-#' 
-#' @param chm raster. canopy height model
-#' @param trees data.frame. the first two columns contain xy coordinates, and the third is the value to correlate to the chm (e.g. tree heights or diameters)
-#' @param mask raster. raster mask of tree inventory area
-#' @param buffer numeric. radius of the circular buffer area of possible translations
-#' @param pas numeric. increment step of translations within buffer area to compute correlation values, should be a multiple of raster resolution
-#' @param dm numeric. minimum distance between two local maxima in meters
-#' @param plot boolean. whether to display the results or not
-#' @seealso \code{\link{rastersMovingCor}}, \code{\link{rasterLocalmax}}
-#' @return A list with two elements : first the correlation raster returned by \code{\link{rastersMovingCor}}, second a data.frame returned by \code{\link{rasterLocalmax}}
-#' @references Monnet, J.-M. and Mermin, E. 2014. Cross-Correlation of Diameter Measures for the Co-Registration of Forest Inventory Plots with Airborne Laser Scanning Data. Forests 2014, 5(9), 2307-2326, \url{https://doi.org/10.3390/f5092307}
-#' @examples
-#' # tree inventory
-#' trees <- data.frame(x=c(22.2, 18.3, 18.1), y =c(22.1, 22.7, 18.4), z=c(15,10,15))
-#' 
-#' # mask of inventory area
-#' # empty raster with extent
-#' tree.mask <- circle2Raster(20, 20, 9, resolution=1)
-#' # fill binary mask
-#' tree.mask <- rasterXYMask(rbind(c(20, 20), c(20, 20)), c(9,9), tree.mask, binary=TRUE)
-#' 
-#' # simulate chm raster
-#' chm <- raster::raster()
-#' raster::extent(chm) <- c(0,40,0,40)
-#' raster::res(chm) <- 1
-#' xy <- raster::xyFromCell(chm,1:length(chm))
-#' 
-#' # add Gaussian surfaces to simulate tree crowns
-#' z1 <- trees$z[1]*exp(-((xy[,1]-trees$x[1])^2+(xy[,2]-trees$y[1])^2/2)*trees$z[1]/50)
-#' z2 <- trees$z[2]*exp(-((xy[,1]-trees$x[2])^2+(xy[,2]-trees$y[2])^2/2)*trees$z[2]/50)
-#' z3 <- trees$z[3]*exp(-((xy[,1]-trees$x[3])^2+(xy[,2]-trees$y[3])^2/2)*trees$z[3]/50)
-#' chm <- raster::rasterFromXYZ(cbind(xy,pmax(z1,z2,z3)))#+rnorm(length(z1),0,1)))
-#' 
-#' # translate trees
-#' trees$x <- trees$x-2
-#' trees$y <- trees$y+4
-#' 
-#' coregistration <- coregistration(chm, trees, mask=tree.mask, buffer=8, pas=1, dm=1, plot=TRUE)
-#' coregistration$local.max[,c("dx1", "dy1")]
-#' 
-#' \dontrun{
-#' # plot raster
-#' raster::plot(coregistration$correlation.raster)
-#' abline(h=0, lty=2)
-#' abline(v=0, lty=2)
-#' # add location of two local maxima
-#' points(coregistration$local.max[1,c("dx1","dx2")],
-#' coregistration$local.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3, col="red")}
-#' @export
-coregistration <- function(chm, trees, mask= NULL, buffer=19, pas=0.5, dm=2, plot=TRUE)
-{
-  # compute virtual chm from tree inventory
-  virtualchm <- raster::rasterize(trees[,1:2], mask, trees[,3],fun=max)
-  # fill NA values with 0
-  virtualchm[is.na(virtualchm)] <- 0
-  #
-  # compute correlation raster 
-  r.correlation <- rastersMovingCor(chm, virtualchm, mask=mask, buffer=buffer, pas=pas)
-  # analyse correlation image
-  resul <- rasterLocalmax(r.correlation)
-  # display results
-  if (plot)
-  {
-    # CHM
-    raster::plot(chm, asp=1)
-    # display initial tree positions
-    graphics::points(trees[,1], trees[,2], cex=trees[,3]/40)
-    # display coregistered tree positions
-    graphics::points(trees[,1]+resul$dx1, trees[,2]+resul$dy1, cex=trees[,3]/20, col="red")
-    graphics::legend("topleft", c("Initial", "Coregistered"), pch=1, col=c("black", "red"))
-  }
-  list(correlation.raster=r.correlation, local.max=resul)
-}
-# 
\ No newline at end of file
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/laschablais3-data.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/laschablais3-data.R
deleted file mode 100644
index ce5fffa5bb0dd5076bf13d87e64d84f6c19c2870..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/laschablais3-data.R
+++ /dev/null
@@ -1,22 +0,0 @@
-#' las data in France (Chablais 3 plot)
-#'
-#' Airborne laser scanning data over the Chablais 3 plot, acquired in 2009 by Sintegra, copyright Irstea
-#'
-#' @docType data
-#'
-#' @usage data(laschablais3)
-#'
-#' @format An object of class \code{"LAS"} (e.g. returned by \code{\link[lidR]{LAS}})
-#'
-#' @keywords datasets
-#'
-#' @references Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22. \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-#'
-#' @source Monnet J.-M. Irstea
-#'
-#' @examples
-#' data(laschablais3)
-#' laschablais3
-#' @name laschablais3
-NULL
-"laschablais3"
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.detection.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.detection.R
deleted file mode 100644
index 1ca1c25893a22523f084248e56402f021f3d6c2d..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.detection.R
+++ /dev/null
@@ -1,516 +0,0 @@
-# package lidaRtRee
-# Copyright Irstea
-# Author(s): Jean-Matthieu Monnet
-# Licence: LGPL-3
-########################### FUNCTIONS FOR TREE DETECTION #############################
-#
-######################################
-#' Disk-shaped matrix mask
-#' 
-#' Creates a matrix with TRUE values shaping a centered disk
-#'
-#' @param width numeric. disk width in pixels, should be an uneven number
-#' @return A matrix with 1 for pixels inside the disk, 0 outside
-#' @examples
-#' createDisk(7)
-#' @export
-createDisk <- function(width=5)
-{
-  if (width %% 2 != 1) {stop("Mask width should be uneven")}
-  # matrix of row indices
-  row.mat <- matrix(rep(1:width,width), nrow=width, ncol=width)
-  # matrix of column indices
-  col.mat <- matrix(rep(1:width,width), nrow=width, ncol=width, byrow=T)
-  radius <- width %/%2
-  row.mat <- row.mat - radius -1
-  col.mat <- col.mat - radius -1
-  mask <- (col.mat^2 + row.mat^2) <= radius ^ 2
-  mask
-}
-######################################
-#' Image pre-processing (non-linear filtering and Gaussian smoothing)
-#'
-#' applies two filters to an image:
-#' \enumerate{
-#' \item A non-linear filter: closing (\code{\link[imager]{mclosing}}) with disk kernel, or median (\code{\link[imager]{medianblur}}) with square kernel
-#' \item A 2D Gaussian smoother (The \code{\link[imager]{deriche}} filter is applied on both dimensions). Value-dependent smoothing is possible
-#' }
-#'
-#' @param dem.c cimg object (e.g. obtained with \code{\link[imager]{as.cimg}})
-#' @param nlFilter string. type of non-linear filter to apply: "None", "Closing" or "Median"
-#' @param nlSize numeric. kernel width in pixel for non-linear filtering
-#' @param sigmap numeric or matrix. if a single number is provided, sigmap is the standard deviation of the Gaussian filter in pixel, 0 corresponds to no smoothing. In case of matrix, the first column corresponds to the standard deviation of the filter, and the second to thresholds for image values (e.g. a filter of standard deviation specified in line \code{i} is applied to pixels in image which values are between thresholds indicated in lines \code{i} and \code{i+1}). Threshold values should be ordered in increasing order.
-#' @examples
-#' data(chmchablais3)
-#' # fill NA values
-#' chmchablais3[is.na(chmchablais3)] <- 0
-#' 
-#' # convert raster to cimg
-#' chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-#' 
-#' # filtering with median and Gaussian smoothing
-#' im <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0.8)
-#' 
-#' # filtering with median filter and value-dependent Gaussian smoothing
-#' # (less smoothing for values between 0 and 15)
-#' im2 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=cbind(c(0.2,0.8), c(0,15)))
-#' 
-#' \dontrun{
-#' # plot original image
-#' plot(chmchablais3, main="Initial image")
-#' 
-#' # plot image after median filter
-#' plot(im$non.linear.image, main="Median filter")
-#' 
-#' # plot image after median and Gaussian filters
-#' plot(im$smoothed.image, main="Smoothed image")
-#' 
-#' # plot image after median and value-dependent Gaussian filters
-#' plot(im2$smoothed.image, main="Value-dependent smoothing")}
-#' @seealso \code{\link{maximaDetection}}, filters of imager package: \code{\link[imager]{mclosing}}, \code{\link[imager]{medianblur}}, \code{\link[imager]{deriche}}
-#' @return A list of two cimg objects: image after non-linear filter and image after both filters
-#' @export
-demFiltering <- function(dem.c, nlFilter="Closing", nlSize=5, sigmap=0.3)
-{
-  # non-linear filtering
-  dem.nl <- dem.c
-  if (nlFilter=="Closing")
-  {
-    # closing with structuring element (disk)
-    strel <- imager::as.cimg(createDisk(nlSize))
-    dem.nl <- imager::mclosing(dem.nl,strel)
-  }
-  if (nlFilter=="Median")
-  {
-    # median on square window
-    strel <- imager::as.cimg(createDisk(nlSize))
-    dem.nl <- imager::medianblur(dem.nl,nlSize)
-  }
-  #
-  # linear filtering
-  # gaussian smoothing
-  # if several values of sigma are provided, value-dependent smoothin is performed
-  if (length(sigmap)>1)
-  {
-    dem.gs <- dem.nl
-    # for each value of sigma
-    for (i in 1:nrow(sigmap))
-    {
-      # perform 2D smoothing
-      dummy <- imager::deriche(dem.nl, sigmap[i,1], axis="x")
-      dummy <- imager::deriche(dummy, sigmap[i,1], axis="y")
-      # identify pixels which values are superior to the threshold
-      temp <- dem.gs>=sigmap[i,2]
-      # update only those values in the output
-      dem.gs[temp] <- dummy[temp]
-    }
-  } else { # if only one value of sigma is provided
-    if (sigmap>0)
-    {
-      dem.gs <- imager::deriche(dem.nl, sigmap, axis="x")
-      dem.gs <- imager::deriche(dem.gs, sigmap, axis="y")
-    } else { # if 0, no smoothing is performed
-      dem.gs <- dem.nl
-    }
-  }
-  list(non.linear.image=dem.nl, smoothed.image=dem.gs)
-}
-###################################
-#' Local maxima extraction on image
-#' 
-#' Variable window size maxima detection is performed on the image to extract local maxima position and calculate the window size where they are global maxima
-#'
-#' @param dem.gs cimg object. input image (e.g. as created by \code{\link[imager]{cimg}})
-#' @param dem.res numeric. image resolution
-#' @param max.width numeric. maximum kernel width in pixel to check for local maximum
-#' @return A cimg object which values are the radius (n) in meter of the square window (width 2n+1) where the center pixel is global maximum
-#' @examples
-#' data(chmchablais3)
-#' # fill NA values
-#' chmchablais3[is.na(chmchablais3)] <- 0
-#' 
-#' # record raster resolution
-#' resolution <- raster::res(chmchablais3)[1]
-#' 
-#' # convert raster to cimg
-#' chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-#' 
-#' # maxima detection
-#' maxi <- maximaDetection(chmchablais3, resolution)
-#' 
-#' \dontrun{
-#' # plot original image
-#' plot(chmchablais3, main="Initial image")
-#' 
-#' # plot maxima image
-#' plot(maxi, main="Local maxima")}
-#' @seealso \code{\link{demFiltering}}, \code{\link{maximaSelection}}
-#' @export
-maximaDetection <- function(dem.gs, dem.res=1, max.width=21)
-{
-  max.radius <- max.width %/% 2
-  # extraction of maxima on variable window size (from 0 to max.radius)
-  maxi <- NULL
-  for (i in 1:max.radius)
-  {
-    # create square structuring element for dilation
-    strel <- imager::imfill(2*i+1,2*i+1,val=1)
-    # if initialization check where pixel values are equal in original image and in image dialted by structuring element
-    if (is.null(maxi))
-    {
-      maxi <- imager::as.cimg(dem.gs == imager::dilate(dem.gs,strel))*i
-      # otherwise perform check an update previous result
-    } else {
-      maxi <- imager::parmax(list(maxi, imager::as.cimg(dem.gs == imager::dilate(dem.gs,strel))*i))
-    }
-  }
-  # convert window size from pixels to meters
-  maxi[maxi>0] <- (maxi[maxi>0] + 1)*dem.res
-  maxi
-}
-################################
-#' Image maxima selection based on values and neighborhood of local maxima
-#' 
-#' In a maxima image (output of \code{\link{maximaDetection}}), sets values to zero for pixels which
-#' \enumerate{
-#' \item value in the initial image (from which maxima were detected) are below a threshold 
-#' \item values in the maxima image (corresponding to the radius of the neighborhood where they are global maxima) are below a threshold depending on the initial image value.
-#' }
-#'
-#' @param maxi cimg object. image with local maxima (typically output from \code{\link{maximaDetection}}, image values correspond to neighborhood radius on which pixels are global maxima in the initial image)
-#' @param dem.nl cimg object. initial image from which maxima were detected
-#' @param hmin numeric. minimum value in initial image for a maximum to be selected
-#' @param dmin numeric. intercept term for selection of maxima depending on neighborhood radius: \code{maxi >= dmin + dem.nl * dprop}
-#' @param dprop numeric. proportional term for selection of maxima depending on neighborhood radius: \code{maxi >= dmin + dem.nl * dprop}
-#' @return A cimg object which values are the radius (n) in meter of the square window (width 2n+1) where the center pixel is global maximum and which fulfill the selection criteria
-#' @examples
-#' data(chmchablais3)
-#' # fill NA values
-#' chmchablais3[is.na(chmchablais3)] <- 0
-#' 
-#' # record raster resolution
-#' resolution <- raster::res(chmchablais3)[1]
-#' 
-#' # convert raster to cimg
-#' chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-#' 
-#' # maxima detection
-#' maxi <- maximaDetection(chmchablais3, resolution)
-#' 
-#' # several maxima selection settings
-#' selected.maxi.hmin <- maximaSelection(maxi, chmchablais3, hmin=15)
-#' selected.maxi.dm <- maximaSelection(maxi, chmchablais3, dm=2.5)
-#' selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-#' 
-#' # corresponding count number of remaining maxima
-#' table(maxi)
-#' table(selected.maxi.hmin)
-#' table(selected.maxi.dm)
-#' table(selected.maxi)
-#' 
-#' \dontrun{
-#' # plot original image
-#' plot(chmchablais3, main="Initial image")
-#' 
-#' # plot maxima images, original and first case
-#' plot(maxi, main="Local maxima")
-#' plot(selected.maxi, main="Selected maxima")}
-#' 
-#' @seealso \code{\link{maximaDetection}}
-#' @export
-maximaSelection <- function(maxi,dem.nl,hmin=0,dmin=0,dprop=0)
-{
-  # height filter
-  maxi[dem.nl < hmin] <- 0
-  # distance filter
-  maxi[maxi < (dmin + dem.nl * dprop)] <- 0
-  maxi
-}
-################################
-#' Image segmentation by seed-based watershed algorithm
-#'
-#' performs a seed-based watershed segmentation and outputs two images: one with segment id and one where the segments are filled with the highest value of the segment in the initial image
-#'
-#' @param maxi cimg object. image with seed points (e.g. from \code{\link{maximaDetection}} or \code{\link{maximaSelection}} )
-#' @param dem.nl cimg object. image for seed propagation (typically initial image used for maxima detection).
-#' @return A list of 2 cimg objects (image of segments id, image of maximum value in segment)
-#' @examples
-#' data(chmchablais3)
-#' # fill NA values
-#' chmchablais3[is.na(chmchablais3)] <- 0
-#' 
-#' # record raster resolution
-#' resolution <- raster::res(chmchablais3)[1]
-#' 
-#' # convert raster to cimg
-#' chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-#' 
-#' # median filter
-#' chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-#' 
-#' # maxima detection
-#' maxi <- maximaDetection(chmchablais3, resolution)
-#' 
-#' # maxima selection
-#' selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-#' 
-#' # segmentation
-#' seg.maxi <- segmentation(maxi, chmchablais3)
-#' seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-#' 
-#' \dontrun{
-#' # plot original image
-#' plot(chmchablais3, main="Median filter")
-#' 
-#' # plot segmented image
-#' plot(seg.maxi$id %% 8, main="Segments, no maxima selection")
-#' plot(seg.selected.maxi$id %% 8, main="Segments, maxima selection")
-#' plot(seg.selected.maxi$maxvalue, main="Max value in segment, maxima selection")}
-#' 
-#' @seealso \code{\link{maximaDetection}}, \code{\link{maximaSelection}}, \code{\link{segAdjust}}
-#' @export
-segmentation <- function(maxi,dem.nl)
-{
-  # maxima locations
-  a <- which(maxi>0)
-  # tree number
-  na <- length(a)
-  # values at maxima locations
-  h <- dem.nl[a]
-  # function which associates a value to id
-  fh <- function(x){h[x]}
-  # create seed image
-  dummy <- maxi
-  # initialise seeds with id
-  dummy[a] <- 1:na
-  # watershed segmentation
-  dem.w <- imager::watershed(dummy,dem.nl)
-  # image where segments are filled with maximum value in image
-  dem.wh <- dem.w
-  dem.wh <- fh(dem.wh)
-  dem.wh <- imager::as.cimg(matrix(dem.wh,nrow(dem.w)))
-  #
-  list(id=dem.w, maxvalue=dem.wh)
-}
-################################
-#' Modification of segments based on values
-#' 
-#' in a segmented image, removes from segments the pixels which values in a reference image is below a certain percentage of the highest value inside the segment. Removed pixels are attributed 0 value.
-#'
-#' @param dem.w cimg object. image with segments id, without 0 values
-#' @param dem.wh cimg object. image with max value inside segment
-#' @param dem.nl cimg object. image with initial values
-#' @param prop numeric. proportional threshold for removal of pixels which initial values are lower than the max height of the segment (\code{dem.nl < prop x dem.wh})
-#' @param min.value numeric. threshold for removel of pixels which initial values are lower (\code{dem.nl < min.value}) 
-#' @param min.maxvalue numeric. threshold for complete removal of segments which maximum value height is smaller to the threshold (\code{dem.wh < min.maxvalue}) 
-#' @return A cimg object: image with modified segments. 
-#' @examples
-#' data(chmchablais3)
-#' # fill NA values
-#' chmchablais3[is.na(chmchablais3)] <- 0
-#' 
-#' # record raster resolution
-#' resolution <- raster::res(chmchablais3)[1]
-#' 
-#' # convert raster to cimg
-#' chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-#' 
-#' # median filter
-#' chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-#' 
-#' # maxima detection and selection
-#' maxi <- maximaDetection(chmchablais3, resolution)
-#' selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-#' 
-#' # segmentation
-#' seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-#' 
-#' # segmentation modification
-#' seg.modif1 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
-#'  chmchablais3, prop=0.5)
-#' seg.modif2 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
-#'  chmchablais3, prop=0, min.value=5, min.maxvalue=10)
-#' 
-#' \dontrun{
-#' # plot initial segmented image
-#' plot(seg.selected.maxi$id %% 8, main="Initial segments")
-#' plot(seg.modif1 %% 8, main="Modified segments 1")
-#' plot(seg.modif2 %% 8, main="Modified segments 2")}
-#' 
-#' @seealso \code{\link{maximaDetection}}, \code{\link{maximaSelection}}
-#' @export
-segAdjust <- function(dem.w, dem.wh, dem.nl, prop=0.3, min.value=2, min.maxvalue=5)
-{
-  # removal of segments with maximum value lower than min.maxvalue
-  dem.w[dem.wh < min.maxvalue] <- 0
-  # removal of pixels with values lower than prop * max value in segment
-  dem.w[dem.nl < prop * dem.wh] <- 0
-  # removal of pixels with values lower than min.value
-  dem.w[dem.nl < min.value] <- 0
-  dem.w
-}
-################################
-#' Preprocessing and segmentation of raster image for tree identification
-#' 
-#' global function for preprocessing (filtering), maxima detection and selection, segmentation and segmentation adjustment of a raster image.
-#'
-#' @param dem raster object or string indicating location of raster file (typically a canopy height model)
-#' @param nlFilter string. specifies the non-linear filter for image pre-processing, should be an option of function \code{\link{demFiltering}}
-#' @param nlSize numeric. width of kernel of non-linear filter in pixels
-#' @param sigma numeric or matrix. if a single number is provided, sigmap is the standard deviation of Gaussian filter in meters, 0 corresponds to no smoothing. In case of matrix, the first column corresponds to the standard deviation of the filter, and the second to thresholds for image values (e.g. a filter of standard deviation specified in line \code{i} is applied to pixels in image which values are between thresholds indicated in lines \code{i} and \code{i+1}). Threshold values should be ordered in increasing order.
-#' @param dmin numeric. treetop minimum distance to next higher pixel in meters
-#' @param dprop numeric. number defining the treetop minimum distance as proportion of height to next higher pixel
-#' @param hmin numeric. minimum treetop height
-#' @param propHouppier numeric. minimum height of tree crown as proportion of treetop height
-#' @param minHouppier numeric. minimum crown height
-#' @references Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. Section 6.2 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-#' 
-#' Monnet, J.-M., Mermin, E., Chanussot, J., Berger, F. 2010. Tree top detection using local maxima filtering: a parameter sensitivity analysis. Silvilaser 2010, the 10th International Conference on LiDAR Applications for Assessing Forest Ecosystems, September 14-17, Freiburg, Germany, 9 p. \url{https://hal.archives-ouvertes.fr/hal-00523245/document}
-#' @examples
-#' data(chmchablais3)
-#' 
-#' # tree segmentation
-#' segments <- treeSegmentation(chmchablais3)
-#' segments2<- treeSegmentation(chmchablais3, nlFilter="Median", nlSize=3,
-#'   sigma=cbind(c(0.2,0.8), c(0,15)),dmin=0,dprop=0,hmin=10,propHouppier=0.5,minHouppier=5)
-#' 
-#' \dontrun{
-#' # plot initial image segments
-#' plot(chmchablais3, main="Initial image")
-#' plot(segments$smoothed.dem, main="Filtered image")
-#' plot(segments$local.maxima, main="Local maxima")
-#' #
-#' # replace segment with id 0 (not a tree) with NA
-#' segments$segments[segments$segments==0] <- NA
-#' plot(segments$segments %% 8 , main="Segments")
-#' #
-#' # plot segmentation with other parameters
-#' segments2$segments[segments2$segments==0] <- NA
-#' plot(segments2$segments %% 8, main="Segments2")}
-#' 
-#' @seealso \code{\link{demFiltering}}, \code{\link{maximaDetection}}, \code{\link{maximaDetection}}, \code{\link{maximaSelection}}, \code{\link{segmentation}}, \code{\link{segAdjust}}, \code{\link{treeExtraction}}
-#' @return A list of 4 rasters: selected local maxima (values = distance to higher pixel), segments, non-linear preprocessed dem, smoothed preprocessed dem
-#' @export
-treeSegmentation <- function(dem, nlFilter="Closing", nlSize=5, sigma=0.3,dmin=0,dprop=0.05,hmin=5,propHouppier=0.3,minHouppier=2)
-{
-  #
-  if (minHouppier > hmin) {stop("minimum tree height lower than minimum crown height")}
-  if (is.character(dem)) {dem <- raster::raster(dem)}
-  # convert NAs to 0s
-  dem[is.na(dem)] <- 0
-  # convert to cimg
-  dem.c <- imager::as.cimg(raster::as.matrix(dem))
-  #
-  # conversion of Gaussian filter standard deviation from meters to pixels
-  if (length(sigma==1))
-  {
-    sigma <- sigma/raster::res(dem)[1]
-  } else {
-    sigma[,2] <- sigma[,2]/raster::res(dem)[1]
-  }
-  # dem filtering 
-  temp <- demFiltering(dem.c, nlFilter=nlFilter, nlSize=nlSize, sigmap=sigma)
-  dem.nl <- temp[[1]]
-  dem.gs <- temp[[2]]
-  #
-  # maxima detection
-  maxi <- maximaDetection(dem.gs,raster::res(dem)[1])
-  #
-  # maxima selection
-  maxi <- maximaSelection(maxi,dem.nl,0,dmin,dprop) # no selection based on top height at this stage, otherwise some artefacts occur in the watershed step
-  #
-  # segmentation
-  temp <- segmentation(maxi,dem.nl)
-  dem.w <- temp[[1]]
-  dem.wh <- temp[[2]]
-  #
-  # segmentation adjustment
-  dem.w <- segAdjust(dem.w,dem.wh,dem.nl,propHouppier,minHouppier, hmin) # removal of trees with top heigth < hmin
-  # remove trees from r.maxi
-  maxi[dem.w==0] <- 0
-  #
-  # conversion to raster
-  r.maxi <- raster::raster(as.matrix(maxi))
-  r.dem.nl <- raster::raster(as.matrix(dem.nl))
-  r.dem.gs <- raster::raster(as.matrix(dem.gs))
-  r.dem.w <- raster::raster(as.matrix(dem.w))
-  raster::extent(r.maxi) <- raster::extent(r.dem.w) <- raster::extent(r.dem.nl) <- raster::extent(r.dem.gs) <- raster::extent(dem)
-  #
-  list(local.maxima=r.maxi, segments.id=r.dem.w, filled.dem=r.dem.nl, smoothed.dem=r.dem.gs)
-}
-################################
-#' Tree extraction
-#' 
-#' creates a dataframe with segment id, height and coordinates of maxima, surface and volume, computed from three images: initial, local maxima and segmented, typically obtained with \code{\link{treeSegmentation}}
-#'
-#' @param r.dem.nl raster object. raster of canopy height model, preferably filtered to avoid effect of holes on volume and surface computation
-#' @param r.maxi raster object. raster positive values at local maxima
-#' @param r.dem.w raster object. segmented raster
-#' @param r.mask raster object. only segments which maxima are inside the mask are extracted
-#' @return A data.frame with tree id, local maximum stats (height, coordinates, dominance radius), surface and volume.
-#' @examples
-#' data(chmchablais3)
-#' 
-#' # tree segmentation
-#' segments <- treeSegmentation(chmchablais3)
-#' 
-#' # tree extraction
-#' trees <- treeExtraction(segments$filled.dem, segments$local.maxima, segments$segments.id)
-#' summary(trees)
-#' 
-#' \dontrun{
-#' # plot initial image
-#' plot(chmchablais3)
-#' 
-#' #' add segment contours
-#' contours <- raster::rasterToPolygons(segments$segments.id, dissolve=T)
-#' plot(contours, add=T, border="white")
-#' 
-#' # add treetop positions
-#' points(trees$x, trees$y, cex=trees$h/20)}
-#'  
-#' @seealso \code{\link{treeSegmentation}}
-#' @export
-treeExtraction <- function(r.dem.nl, r.maxi, r.dem.w, r.mask=NULL)
-{
-  # apply mask to remove maxima outside of region of interest
-  if (!is.null(r.mask))
-  {
-    r.maxi <- r.maxi * r.mask
-  }
-  # segments surface
-  s <- data.frame(t(table(raster::values(r.dem.w))))[,-1]
-  names(s) <- c("id","s")
-  s$s <- s$s * raster::res(r.dem.nl)[1] * raster::res(r.dem.nl)[2]
-  # segments volume
-  v <- stats::aggregate(raster::values(r.dem.nl), by=list(raster::values(r.dem.w)), FUN=sum)
-  names(v) <- c("id","v")
-  v$v <- v$v * raster::res(r.dem.nl)[1] * raster::res(r.dem.nl)[2]
-  #
-  # compute surface and volume inside mask, if mask is not null
-  if (!is.null(r.mask))
-  {
-    # segments surface in mask
-    sp <- data.frame(t(table(raster::values(r.dem.w*r.mask))))[,-1]
-    names(sp) <- c("id","sp")
-    sp$sp <- sp$sp * raster::res(r.dem.nl)[1] * raster::res(r.dem.nl)[2]
-    # segments volume in mask
-    vp <- stats::aggregate(raster::values(r.dem.nl*r.mask), by=list(raster::values(r.dem.w)), FUN=sum)
-    names(vp) <- c("id","vp")
-    vp$vp <- vp$vp * raster::res(r.dem.nl)[1] * raster::res(r.dem.nl)[2]
-  }
-  #
-  # extract segment id, height and dom.radius
-  cells <- which(raster::values(r.maxi)>0)
-  coord <- raster::xyFromCell(r.maxi,cells)
-  segms <- data.frame(coord,id=raster::values(r.dem.w)[cells],h=raster::values(r.dem.nl)[cells],dom.radius=raster::values(r.maxi)[cells])
-  segms <- merge(segms, s, all.x = T)
-  segms <- merge(segms, v, all.x = T)
-  if (!is.null(r.mask))
-  {
-    segms <- merge(segms, sp, all.x = T)
-    segms <- merge(segms, vp, all.x = T)
-  }
-  segms
-}
-#
\ No newline at end of file
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.match.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.match.R
deleted file mode 100644
index cdca22f2efc0efd71e8a62e8678ad5ab029ad463..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/tree.match.R
+++ /dev/null
@@ -1,318 +0,0 @@
-# package lidaRtRee
-# Copyright Irstea
-# Author(s): Jean-Matthieu Monnet
-# Licence: LGPL-3
-########################### FUNCTIONS FOR TREE MATCHING #############################
-#
-######################################
-#' 3D matching of detected tree top positions with reference positions
-#' 
-#' First computes a matching index for each potential pair associating a detected with a reference tree. This index is the 3D distance between detected and reference points, divided by a maximum matching distance set by user-defined parameters. Pairs with the lowest index are then iteratively associated.
-#' 
-#' @param lr data.frame or matrix. 3D coordinates (X Y Height) of reference positions
-#' @param ld data.frame or matrix. 3D coordinates (X Y Height) of detected positions
-#' @param deltaGround numeric. buffer around trunk position
-#' @param hPrec numeric. buffer around apex position (reference Height)
-#' @param computeStat boolean. should matching stats be computed
-#' @return A dataframe with matched pairs (row of reference positions in first column, and row of detected positions in second column) and corresponding 3D distances
-#' @references Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 53-55 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-#' 
-#' Monnet, J.-M., Mermin, E., Chanussot, J., Berger, F. 2010. Tree top detection using local maxima filtering: a parameter sensitivity analysis. Silvilaser 2010, the 10th International Conference on LiDAR Applications for Assessing Forest Ecosystems, September 14-17, Freiburg, Germany, 9 p. \url{https://hal.archives-ouvertes.fr/hal-00523245/document}
-#' @seealso \code{\link{plot2Dmatched}}, \code{\link{histDetection}}
-#' @examples
-#' # create reference and detected trees
-#' ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-#' def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#' #
-#' # match trees
-#' match1 <- treeMatching(ref.trees, def.trees)
-#' match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-#' match1
-#' match2
-#' 
-#' \dontrun{
-#' # 2D display of matching result
-#' plot2Dmatched(ref.trees, def.trees, match1)
-#' plot2Dmatched(ref.trees, def.trees, match2)}
-#' @export
-treeMatching <- function(lr, ld, deltaGround=2.1, hPrec=0.14, computeStat=TRUE)
-{
-  # coefficients for max matching squared radius ( rmax = deltaGround + hPrec * HEIGHT -> rmax^2 = deltaGround^2 + 2* hPrec * deltaGround * HEIGHT + hPrec^2 * HEIGHT^2)
-  d2max0 <- deltaGround^2
-  d2max1 <- 2* hPrec * deltaGround
-  d2max2 <- hPrec^2
-  # number of positions
-  nr <- nrow(lr)
-  nd <- nrow(ld)
-  #
-  # max distance for matching (depends on reference tree height)
-  norm.f <- d2max0 + d2max1 * lr[,3] + d2max2 * lr[,3] * lr[,3]
-  #
-  # create matrix of of matching indices (row : detected position, column : reference position)
-  d <- dn <- matrix(NA,nd,nr,dimnames=list(paste("d",1:nd,sep=""),paste("r",1:nr,sep="")))
-  # for each reference tree
-  for (i in 1:nr)
-  {
-    # compute matching index to detected trees
-    # compute distances in each axis
-    dummy <- cbind(ld[,1] - lr[i,1], ld[,2] - lr[i,2], ld[,3] - lr[i,3])
-    # compute 3D distance
-    d[,i]  <- dn[,i] <- apply(dummy^2,1,sum)
-    # divided by max matching squared radius to obtain matching index
-    dn[,i] <- dn[,i]/norm.f[i]
-  }
-  #
-  # tree matching
-  # replace values over the matching limit (pairs where the 3D distance is over the max matching radius of the reference tree) by the limit
-  dn[dn>=1] <- 1
-  #
-  # trees that have no matching possibilities
-  # reference trees (sum of column == number of detected trees)
-  i.r <- which(apply(dn,2,sum)==nrow(dn))
-  if (length(i.r)>0)
-  {
-    # remove from distance matrix
-    dn <- dn[,-i.r]
-  }
-  # detected trees (sum of row == number of reference trees)
-  i.d<- which(apply(dn,1,sum)==ncol(dn))
-  if (length(i.d)>0)
-  {
-    # remove from distance matrix
-    dn <- dn[-i.d,]
-  }
-  #
-  # iterative matching of pairs with the lowest matching index
-  matched <- data.frame()
-  # add one row of "1" and one column to prevent dn from becoming a vector
-  dn <- rbind(dn,rep(1,ncol(dn)))
-  dn <- cbind(dn,rep(1,nrow(dn)))
-  while (min(dn)<1) # while there are values below the matching limit
-  {
-    # find first pair with minimum index
-    coord <- t(which(dn==min(dn),arr.ind=T))[1:2]
-    # store pair
-    matched <- rbind(matched,as.numeric(gsub("d","",gsub("r","",c(colnames(dn)[coord[2]],rownames(dn)[coord[1]])))))
-    # remove pair from matrix
-    dn <- dn[-coord[1],-coord[2]]
-  }
-  if (length(matched)==0)
-  {
-    return(NULL)
-  } else {
-    names(matched)=c("r","d")
-    #
-    # computes stats if required
-    if (computeStat)
-    {
-      matched$h.diff <- ld[matched[,2],3] - lr[matched[,1],3]
-      matched$plan.diff <- sqrt((ld[matched[,2],1] - lr[matched[,1],1])^2 + (ld[matched[,2],2] - lr[matched[,1],2])^2)
-    }
-    return(matched)
-  }
-}
-#
-######################################
-#' Plot of matched pairs of detected and reference trees
-#'
-#' @param lr data.frame or matrix. 3D coordinates (X Y Height) of reference positions
-#' @param ld data.frame or matrix. 3D coordinates (X Y Height) of detected positions
-#' @param matched data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}
-#' @param chm raster object. raster for background display
-#' @param plotBoundary Spatialpolygon. plot boundaries for display
-#' @return no return
-#' @seealso \code{\link{treeMatching}}, \code{\link{histDetection}}
-#' @examples
-#' # create reference and detected trees
-#' ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-#' def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#' #
-#' # compute matching
-#' match1 <- treeMatching(ref.trees, def.trees)
-#' match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-#' 
-#' \dontrun{
-#' # 2D display of matching results
-#' plot2Dmatched(ref.trees, def.trees, match1)
-#' plot2Dmatched(ref.trees, def.trees, match2)}
-#' @export
-plot2Dmatched <- function(lr, ld, matched, chm=NULL, plotBoundary=NULL)
-{
-  # colors
-  couleur.lr <- rep("red",nrow(lr))
-  couleur.ld <- rep("red",nrow(ld))
-  couleur.lr[matched[,"r"]] <- "blue"
-  couleur.ld[matched[,"d"]] <- "blue"
-  #
-  # display raster background or not
-  if (!is.null(chm))
-  {
-    raster::plot(chm, asp=1) 
-    # add points of detected and reference trees
-    graphics::points(rbind(lr[,1:2],ld[,1:2]),pch=c(rep(1,nrow(lr)),rep(2,nrow(ld))),asp=1,cex=c(lr[,3],ld[,3])/20,col=c(couleur.lr,couleur.ld))
-  } else {
-    # add points of detected and reference trees
-    graphics::plot(rbind(lr[,1:2],ld[,1:2]),pch=c(rep(1,nrow(lr)),rep(2,nrow(ld))),asp=1,cex=c(lr[,3],ld[,3])/20,col=c(couleur.lr,couleur.ld))
-    }
-  # 
-  # draw lines between pairs
-  for (i in 1:nrow(matched))
-  {
-    graphics::lines(rbind(lr[matched[i,1],1:2],ld[matched[i,2],1:2]),col="blue")
-  }
-  # add plot boundary
-  if (!is.null(plotBoundary))
-  {sp::plot(plotBoundary,add=T)}
-  #
-  # legend
-  graphics::legend("topleft", c("reference", "detected", "matched", "not matched"), col=c("black", "black", "blue", "red"), pch=c(1,2,15,15))
-}
-#
-#####################################
-#' Histogram of detection
-#'
-#' Displays the histogram of tree heights of three categories: true detections, omissions, and false detections.
-#'
-#' @param lr data.frame or matrix. 3D coordinates (X Y Height) of reference positions
-#' @param ld data.frame or matrix. 3D coordinates (X Y Height) of detected positions
-#' @param matched data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}
-#' @param plot boolean. should the histogram be displayed or not
-#' @return A list with three numerics: numbers of true detections, omissions and false detections
-#' @seealso \code{\link{treeMatching}}
-#' @examples
-#' # create reference and detected trees
-#' ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-#' def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#' #
-#' # tree matching with different buffer size
-#' match1 <- treeMatching(ref.trees, def.trees)
-#' match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-#' #
-#' # corresponding number of detections
-#' histDetection(ref.trees, def.trees, match1, plot=FALSE)
-#' histDetection(ref.trees, def.trees, match2, plot=FALSE)
-#' 
-#' \dontrun{
-#' # 2D display of matching result
-#' histDetection(ref.trees, def.trees, match1)
-#' histDetection(ref.trees, def.trees, match2)}
-#' @export
-histDetection <- function(lr, ld, matched, plot=TRUE)
-{
-  dummy <- list()
-  # true detections
-  dummy[[1]] <- lr[matched[,1],3]
-  # true omissions
-  dummy[[2]] <- lr[-matched[,1],3]
-  # false detections
-  dummy[[3]] <- ld[-matched[,2],3]
-  if (plot)
-  {
-    # draw histogram
-    histStack(dummy,breaks=seq(from=0,to=ceiling(max(lr[,3],ld[,3])/5)*5,by=5),col=c("green","red","blue"))
-    graphics::axis(2,mgp=c(0.5,0.5,0))
-    graphics::mtext(side=2,text="Number of trees",line=1.3)
-    graphics::mtext(side=1,text="Height classes (m)",line=1.3)
-    graphics::legend("topright",c("True positive","False negative","False positive"),pch=15,col=c("green","red","blue"))
-  }
-  #
-  list(true.detections=length(dummy[[1]]), false.detections=length(dummy[[3]]), omissions=length(dummy[[2]]))
-}
-######################################
-#' Stacked histogramm
-#'
-#' @param x list of vectors. values for each category
-#' @param breaks vector. breaks for histogram bins
-#' @param col vector. colors for each category
-#' @param breaksFun function for breaks display
-#' @return no return
-#' @export
-#'
-histStack <- function(x, breaks, col=NULL, breaksFun=paste)
-{
-  if(!is.list(x))
-    stop("'x' must be a list.")
-  if (is.null(col)) { col <- 1:length(x)}
-  bars <- NULL
-  for (i in 1:length(x)) {
-    if(!is.numeric(x[[i]]))
-      paste("Element", i, "of 'x' is not numeric.")
-    h <- graphics::hist(x[[i]], breaks=breaks, plot=FALSE)
-    bars <- rbind(bars, h$counts)
-  }
-  # grDevices::dev.new(width=3.5, height=3.5)
-  graphics::par(mar=c(2.5,2.5,0.5,0.5))
-  graphics::barplot(bars, names.arg=NULL, col=col, space=0,yaxt="n")
-  at     = seq(along=h$breaks)-1
-  modulo = ceiling(length(at)/10)
-  sel    = (at %% modulo == 0)
-  graphics::axis(side=1,at=at[sel],labels=breaksFun(h$breaks)[sel],mgp=c(0.5,0.5,0))
-}
-#######################################
-#' Regression of detected heights VS reference heights
-#' 
-#' Computes a linear regression model between the reference heights and the detected heights of matched pairs.
-#'
-#' @param lr data.frame or matrix. 3D coordinates (X Y Height) of reference positions
-#' @param ld data.frame or matrix. 3D coordinates (X Y Height) of detected positions
-#' @param matched data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}
-#' @param plot boolean. indicates whether results should be plotted
-#' @param species vector of strings. species for standardized color use by call to \code{\link{speciesColor}}
-#' @param limits vector of two numerics. range to be plotted
-#' @return A list with two elements. First one is the linear regression model, second one is a list with stats (root mean square error, bias and standard deviation of detected heights compared to reference heights).
-#' @seealso \code{\link{treeMatching}}
-#' @examples
-#' # create tree locations and heights
-#' ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-#' def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#' 
-#' # tree matching
-#' match1 <- treeMatching(ref.trees, def.trees)
-#' 
-#' # height regression
-#' reg <- heightRegression(ref.trees, def.trees, match1, plot=FALSE, 
-#'   species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30))
-#' summary(reg$lm)
-#' reg$stats
-#' 
-#' \dontrun{
-#' # display plot
-#' reg <- heightRegression(ref.trees, def.trees, match1, 
-#'   species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30), plot=TRUE)}
-#' @export
-#'
-heightRegression <-function(lr, ld, matched, plot=T, species=NULL, limits=NULL)
-{
-  app <- data.frame(Hm=lr[matched[,1],3], Hl=ld[matched[,2],3])
-  reg<-stats::lm(Hm~Hl,data=app)
-  if (plot)
-  {
-    # apply species-specific colors
-    if (!is.null(species))
-    {
-      # load palette
-      color <- speciesColor()
-      # extract corresponding colors
-      col1 <- color[as.character(species[matched[,1]]),c("col","abvr")]
-    } else { col1 <- data.frame(col="black")}
-    # grDevices::dev.new(height=2.5,width=2.5)
-    graphics::par(mar=c(2.5,2.5,0.5,0.5))
-    if (is.null(limits)) {limits <- c(0,40)}#range(c(app$Hm,app$Hl)).*c(0.9,1.1)
-    graphics::plot(app$Hl,app$Hm,xlim=limits,ylim=limits,pch=4,cex=0.6,col=col1$col,xlab="NA",ylab="NA",yaxt="n",xaxt="n")
-    graphics::axis(2,mgp=c(0.5,0.5,0))
-    graphics::axis(1,mgp=c(0.5,0.5,0))
-    graphics::mtext(side=2,text="Reference height (m)",line=1.3)
-    graphics::mtext(side=1,text="Detected height (m)",line=1.3)
-    graphics::abline(c(0,1),lty=1)
-    graphics::abline(c(reg$coefficients[1],reg$coefficients[2]),lty=2)
-    graphics::text(27,9,paste("n = ",nrow(app),sep=""))
-    graphics::text(27,6,paste("h = ",round(reg$coefficients[2],digits=2)," x hl + ",round(reg$coefficients[1],digits=2),sep=""))
-    graphics::text(27,2.75,paste("adj-R2 = ",round(summary(reg)$adj.r.squared,digits=2),sep=""))
-    if (!is.null(species))
-    {
-      texte <- sort(unique(col1$abvr))
-      graphics::legend("topleft", texte, col=color[texte,"col"],pch=15,cex=1,y.intersp = 1)
-    }
-  }
-  list(lm=reg, stats=list(rmse=sqrt(sum(app$Hm-app$Hl)^2/nrow(app)), bias=mean(app$Hl-app$Hm), sd=stats::sd(app$Hl-app$Hm)))
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/treeinventorychablais3-data.R b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/treeinventorychablais3-data.R
deleted file mode 100644
index 28015321e205aaa02604248ab3359ee5624a93a5..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/R/treeinventorychablais3-data.R
+++ /dev/null
@@ -1,31 +0,0 @@
-#' @name treeinventorychablais3
-#' 
-#' @title Tree inventory data in France (Chablais 3 plot, July 2010)
-#' 
-#' @description All trees with diameter at breast height >= 7.5 cm are inventoried on a 50m x 50m plot.
-#' 
-#' @docType data
-#'
-#' @usage data(treeinventorychablais3)
-#'
-#' @format A dataframe with columns:
-#' \enumerate{
-#' \item x easting coordinate in Lambert 93
-#' \item y northing coordinate in Lambert 93
-#' \item d dbh (cm)
-#' \item h tree height (m)
-#' \item n tree number
-#' \item s species abreviated as GESP (GEnus SPecies)
-#' \item e appearance (0: missing or lying, 1: normal, 2: broken treetop, 3: dead with branches, 4: snag)
-#' \item t tilted (0: no, 1: yes)
-#' }
-#'
-#' @keywords datasets
-#'
-#' @references Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22 & 34 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-#'
-#' @examples
-#' data(treeinventorychablais3)
-#' summary(treeinventorychablais3)
-NULL
-"treeinventorychablais3"
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/chmchablais3.rda b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/chmchablais3.rda
deleted file mode 100644
index 13848387a0d06a2d222800a75346e612e5721171..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/chmchablais3.rda and /dev/null differ
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/laschablais3.rda b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/laschablais3.rda
deleted file mode 100644
index 0a2e8452aa6343c26d7e88830ebbcb014f87dffd..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/laschablais3.rda and /dev/null differ
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/treeinventorychablais3.rda b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/treeinventorychablais3.rda
deleted file mode 100644
index c6ad9eaeab560025803f0430a60ac9a59ca7c945..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/data/treeinventorychablais3.rda and /dev/null differ
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/chmchablais3.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/chmchablais3.Rd
deleted file mode 100644
index fc76b0b2a966a10cef0896a1a64717b24b3af704..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/chmchablais3.Rd
+++ /dev/null
@@ -1,23 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/chmchablais3-data.R
-\docType{data}
-\name{chmchablais3}
-\alias{chmchablais3}
-\title{Canopy height model (Chablais 3 plot)}
-\format{A raster object}
-\usage{
-data(chmchablais3)
-}
-\description{
-Canopy height model computed from airborne laser scanning data acquired in July 2010.
-}
-\examples{
-data(chmchablais3)
-chmchablais3
-\dontrun{
-raster::plot(chmchablais3)}
-}
-\references{
-Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22 & 34 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-}
-\keyword{datasets}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/circle2Raster.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/circle2Raster.Rd
deleted file mode 100644
index 0c2dc88200491634e66bc80eb99b2f590f3861e9..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/circle2Raster.Rd
+++ /dev/null
@@ -1,28 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coregistration.R
-\name{circle2Raster}
-\alias{circle2Raster}
-\title{Raster corresponding to circle extent}
-\usage{
-circle2Raster(X, Y, radius, resolution = 0.5, buffer = 0.5)
-}
-\arguments{
-\item{X}{numeric. easting coordinate of plot center in meters}
-
-\item{Y}{numeric. northing coordinate of plot center in meters}
-
-\item{radius}{numeric. plot radius in meters}
-
-\item{resolution}{numeric. raster resolution in meters}
-
-\item{buffer}{numeric. buffer to be added to plot radius in meters}
-}
-\value{
-A raster object
-}
-\description{
-Creates an empty raster which extents corresponds to the circle specified by center coordinates, radius and optional buffer size.
-}
-\examples{
-circle2Raster(100, 100, 20, 1, 5)
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/coregistration.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/coregistration.Rd
deleted file mode 100644
index b3252b1dd6fbc6a391c96d5a5e7c841814102660..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/coregistration.Rd
+++ /dev/null
@@ -1,74 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coregistration.R
-\name{coregistration}
-\alias{coregistration}
-\title{Tree inventory and canopy height model coregistration}
-\usage{
-coregistration(chm, trees, mask = NULL, buffer = 19, pas = 0.5, dm = 2,
-  plot = TRUE)
-}
-\arguments{
-\item{chm}{raster. canopy height model}
-
-\item{trees}{data.frame. the first two columns contain xy coordinates, and the third is the value to correlate to the chm (e.g. tree heights or diameters)}
-
-\item{mask}{raster. raster mask of tree inventory area}
-
-\item{buffer}{numeric. radius of the circular buffer area of possible translations}
-
-\item{pas}{numeric. increment step of translations within buffer area to compute correlation values, should be a multiple of raster resolution}
-
-\item{dm}{numeric. minimum distance between two local maxima in meters}
-
-\item{plot}{boolean. whether to display the results or not}
-}
-\value{
-A list with two elements : first the correlation raster returned by \code{\link{rastersMovingCor}}, second a data.frame returned by \code{\link{rasterLocalmax}}
-}
-\description{
-Computes the correlation between the canopy height model and a virtual canopy height model simulated from tree locations, for different translations of tree inventory positions, and outputs the translation corresponding to best estimated co-registration.
-}
-\examples{
-# tree inventory
-trees <- data.frame(x=c(22.2, 18.3, 18.1), y =c(22.1, 22.7, 18.4), z=c(15,10,15))
-
-# mask of inventory area
-# empty raster with extent
-tree.mask <- circle2Raster(20, 20, 9, resolution=1)
-# fill binary mask
-tree.mask <- rasterXYMask(rbind(c(20, 20), c(20, 20)), c(9,9), tree.mask, binary=TRUE)
-
-# simulate chm raster
-chm <- raster::raster()
-raster::extent(chm) <- c(0,40,0,40)
-raster::res(chm) <- 1
-xy <- raster::xyFromCell(chm,1:length(chm))
-
-# add Gaussian surfaces to simulate tree crowns
-z1 <- trees$z[1]*exp(-((xy[,1]-trees$x[1])^2+(xy[,2]-trees$y[1])^2/2)*trees$z[1]/50)
-z2 <- trees$z[2]*exp(-((xy[,1]-trees$x[2])^2+(xy[,2]-trees$y[2])^2/2)*trees$z[2]/50)
-z3 <- trees$z[3]*exp(-((xy[,1]-trees$x[3])^2+(xy[,2]-trees$y[3])^2/2)*trees$z[3]/50)
-chm <- raster::rasterFromXYZ(cbind(xy,pmax(z1,z2,z3)))#+rnorm(length(z1),0,1)))
-
-# translate trees
-trees$x <- trees$x-2
-trees$y <- trees$y+4
-
-coregistration <- coregistration(chm, trees, mask=tree.mask, buffer=8, pas=1, dm=1, plot=TRUE)
-coregistration$local.max[,c("dx1", "dy1")]
-
-\dontrun{
-# plot raster
-raster::plot(coregistration$correlation.raster)
-abline(h=0, lty=2)
-abline(v=0, lty=2)
-# add location of two local maxima
-points(coregistration$local.max[1,c("dx1","dx2")],
-coregistration$local.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3, col="red")}
-}
-\references{
-Monnet, J.-M. and Mermin, E. 2014. Cross-Correlation of Diameter Measures for the Co-Registration of Forest Inventory Plots with Airborne Laser Scanning Data. Forests 2014, 5(9), 2307-2326, \url{https://doi.org/10.3390/f5092307}
-}
-\seealso{
-\code{\link{rastersMovingCor}}, \code{\link{rasterLocalmax}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/createDisk.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/createDisk.Rd
deleted file mode 100644
index 2754683b74739408d365e7a3eed2d996c684f0ea..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/createDisk.Rd
+++ /dev/null
@@ -1,20 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{createDisk}
-\alias{createDisk}
-\title{Disk-shaped matrix mask}
-\usage{
-createDisk(width = 5)
-}
-\arguments{
-\item{width}{numeric. disk width in pixels, should be an uneven number}
-}
-\value{
-A matrix with 1 for pixels inside the disk, 0 outside
-}
-\description{
-Creates a matrix with TRUE values shaping a centered disk
-}
-\examples{
-createDisk(7)
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/demFiltering.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/demFiltering.Rd
deleted file mode 100644
index 4600e5c4201a951a1dcc9077427a13d6b3173547..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/demFiltering.Rd
+++ /dev/null
@@ -1,58 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{demFiltering}
-\alias{demFiltering}
-\title{Image pre-processing (non-linear filtering and Gaussian smoothing)}
-\usage{
-demFiltering(dem.c, nlFilter = "Closing", nlSize = 5, sigmap = 0.3)
-}
-\arguments{
-\item{dem.c}{cimg object (e.g. obtained with \code{\link[imager]{as.cimg}})}
-
-\item{nlFilter}{string. type of non-linear filter to apply: "None", "Closing" or "Median"}
-
-\item{nlSize}{numeric. kernel width in pixel for non-linear filtering}
-
-\item{sigmap}{numeric or matrix. if a single number is provided, sigmap is the standard deviation of the Gaussian filter in pixel, 0 corresponds to no smoothing. In case of matrix, the first column corresponds to the standard deviation of the filter, and the second to thresholds for image values (e.g. a filter of standard deviation specified in line \code{i} is applied to pixels in image which values are between thresholds indicated in lines \code{i} and \code{i+1}). Threshold values should be ordered in increasing order.}
-}
-\value{
-A list of two cimg objects: image after non-linear filter and image after both filters
-}
-\description{
-applies two filters to an image:
-\enumerate{
-\item A non-linear filter: closing (\code{\link[imager]{mclosing}}) with disk kernel, or median (\code{\link[imager]{medianblur}}) with square kernel
-\item A 2D Gaussian smoother (The \code{\link[imager]{deriche}} filter is applied on both dimensions). Value-dependent smoothing is possible
-}
-}
-\examples{
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# filtering with median and Gaussian smoothing
-im <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0.8)
-
-# filtering with median filter and value-dependent Gaussian smoothing
-# (less smoothing for values between 0 and 15)
-im2 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=cbind(c(0.2,0.8), c(0,15)))
-
-\dontrun{
-# plot original image
-plot(chmchablais3, main="Initial image")
-
-# plot image after median filter
-plot(im$non.linear.image, main="Median filter")
-
-# plot image after median and Gaussian filters
-plot(im$smoothed.image, main="Smoothed image")
-
-# plot image after median and value-dependent Gaussian filters
-plot(im2$smoothed.image, main="Value-dependent smoothing")}
-}
-\seealso{
-\code{\link{maximaDetection}}, filters of imager package: \code{\link[imager]{mclosing}}, \code{\link[imager]{medianblur}}, \code{\link[imager]{deriche}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/heightRegression.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/heightRegression.Rd
deleted file mode 100644
index 8b9aa25de7519e1c63a2d67f506ca71134765090..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/heightRegression.Rd
+++ /dev/null
@@ -1,49 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.match.R
-\name{heightRegression}
-\alias{heightRegression}
-\title{Regression of detected heights VS reference heights}
-\usage{
-heightRegression(lr, ld, matched, plot = T, species = NULL, limits = NULL)
-}
-\arguments{
-\item{lr}{data.frame or matrix. 3D coordinates (X Y Height) of reference positions}
-
-\item{ld}{data.frame or matrix. 3D coordinates (X Y Height) of detected positions}
-
-\item{matched}{data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}}
-
-\item{plot}{boolean. indicates whether results should be plotted}
-
-\item{species}{vector of strings. species for standardized color use by call to \code{\link{speciesColor}}}
-
-\item{limits}{vector of two numerics. range to be plotted}
-}
-\value{
-A list with two elements. First one is the linear regression model, second one is a list with stats (root mean square error, bias and standard deviation of detected heights compared to reference heights).
-}
-\description{
-Computes a linear regression model between the reference heights and the detected heights of matched pairs.
-}
-\examples{
-# create tree locations and heights
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-
-# tree matching
-match1 <- treeMatching(ref.trees, def.trees)
-
-# height regression
-reg <- heightRegression(ref.trees, def.trees, match1, plot=FALSE, 
-  species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30))
-summary(reg$lm)
-reg$stats
-
-\dontrun{
-# display plot
-reg <- heightRegression(ref.trees, def.trees, match1, 
-  species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30), plot=TRUE)}
-}
-\seealso{
-\code{\link{treeMatching}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histDetection.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histDetection.Rd
deleted file mode 100644
index 1294727aa6aab5245c38df781e422d4dc3d5b16b..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histDetection.Rd
+++ /dev/null
@@ -1,44 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.match.R
-\name{histDetection}
-\alias{histDetection}
-\title{Histogram of detection}
-\usage{
-histDetection(lr, ld, matched, plot = TRUE)
-}
-\arguments{
-\item{lr}{data.frame or matrix. 3D coordinates (X Y Height) of reference positions}
-
-\item{ld}{data.frame or matrix. 3D coordinates (X Y Height) of detected positions}
-
-\item{matched}{data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}}
-
-\item{plot}{boolean. should the histogram be displayed or not}
-}
-\value{
-A list with three numerics: numbers of true detections, omissions and false detections
-}
-\description{
-Displays the histogram of tree heights of three categories: true detections, omissions, and false detections.
-}
-\examples{
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# tree matching with different buffer size
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-#
-# corresponding number of detections
-histDetection(ref.trees, def.trees, match1, plot=FALSE)
-histDetection(ref.trees, def.trees, match2, plot=FALSE)
-
-\dontrun{
-# 2D display of matching result
-histDetection(ref.trees, def.trees, match1)
-histDetection(ref.trees, def.trees, match2)}
-}
-\seealso{
-\code{\link{treeMatching}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histStack.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histStack.Rd
deleted file mode 100644
index e754d4738ff6c8673671de9d5244e45c4cd1cc58..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/histStack.Rd
+++ /dev/null
@@ -1,23 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.match.R
-\name{histStack}
-\alias{histStack}
-\title{Stacked histogramm}
-\usage{
-histStack(x, breaks, col = NULL, breaksFun = paste)
-}
-\arguments{
-\item{x}{list of vectors. values for each category}
-
-\item{breaks}{vector. breaks for histogram bins}
-
-\item{col}{vector. colors for each category}
-
-\item{breaksFun}{function for breaks display}
-}
-\value{
-no return
-}
-\description{
-Stacked histogramm
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/laschablais3.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/laschablais3.Rd
deleted file mode 100644
index 2355da15bd91bf99014589bd68586ded5472deb0..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/laschablais3.Rd
+++ /dev/null
@@ -1,24 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/laschablais3-data.R
-\docType{data}
-\name{laschablais3}
-\alias{laschablais3}
-\title{las data in France (Chablais 3 plot)}
-\format{An object of class \code{"LAS"} (e.g. returned by \code{\link[lidR]{LAS}})}
-\source{
-Monnet J.-M. Irstea
-}
-\usage{
-data(laschablais3)
-}
-\description{
-Airborne laser scanning data over the Chablais 3 plot, acquired in 2009 by Sintegra, copyright Irstea
-}
-\examples{
-data(laschablais3)
-laschablais3
-}
-\references{
-Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22. \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-}
-\keyword{datasets}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaDetection.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaDetection.Rd
deleted file mode 100644
index 99ac76f3b539314e4fa213fbd7667c825fd64735..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaDetection.Rd
+++ /dev/null
@@ -1,45 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{maximaDetection}
-\alias{maximaDetection}
-\title{Local maxima extraction on image}
-\usage{
-maximaDetection(dem.gs, dem.res = 1, max.width = 21)
-}
-\arguments{
-\item{dem.gs}{cimg object. input image (e.g. as created by \code{\link[imager]{cimg}})}
-
-\item{dem.res}{numeric. image resolution}
-
-\item{max.width}{numeric. maximum kernel width in pixel to check for local maximum}
-}
-\value{
-A cimg object which values are the radius (n) in meter of the square window (width 2n+1) where the center pixel is global maximum
-}
-\description{
-Variable window size maxima detection is performed on the image to extract local maxima position and calculate the window size where they are global maxima
-}
-\examples{
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-\dontrun{
-# plot original image
-plot(chmchablais3, main="Initial image")
-
-# plot maxima image
-plot(maxi, main="Local maxima")}
-}
-\seealso{
-\code{\link{demFiltering}}, \code{\link{maximaSelection}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaSelection.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaSelection.Rd
deleted file mode 100644
index 022a6d6ce349f4629c3a02cd768b955342e5c41b..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/maximaSelection.Rd
+++ /dev/null
@@ -1,66 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{maximaSelection}
-\alias{maximaSelection}
-\title{Image maxima selection based on values and neighborhood of local maxima}
-\usage{
-maximaSelection(maxi, dem.nl, hmin = 0, dmin = 0, dprop = 0)
-}
-\arguments{
-\item{maxi}{cimg object. image with local maxima (typically output from \code{\link{maximaDetection}}, image values correspond to neighborhood radius on which pixels are global maxima in the initial image)}
-
-\item{dem.nl}{cimg object. initial image from which maxima were detected}
-
-\item{hmin}{numeric. minimum value in initial image for a maximum to be selected}
-
-\item{dmin}{numeric. intercept term for selection of maxima depending on neighborhood radius: \code{maxi >= dmin + dem.nl * dprop}}
-
-\item{dprop}{numeric. proportional term for selection of maxima depending on neighborhood radius: \code{maxi >= dmin + dem.nl * dprop}}
-}
-\value{
-A cimg object which values are the radius (n) in meter of the square window (width 2n+1) where the center pixel is global maximum and which fulfill the selection criteria
-}
-\description{
-In a maxima image (output of \code{\link{maximaDetection}}), sets values to zero for pixels which
-\enumerate{
-\item value in the initial image (from which maxima were detected) are below a threshold 
-\item values in the maxima image (corresponding to the radius of the neighborhood where they are global maxima) are below a threshold depending on the initial image value.
-}
-}
-\examples{
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-# several maxima selection settings
-selected.maxi.hmin <- maximaSelection(maxi, chmchablais3, hmin=15)
-selected.maxi.dm <- maximaSelection(maxi, chmchablais3, dm=2.5)
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# corresponding count number of remaining maxima
-table(maxi)
-table(selected.maxi.hmin)
-table(selected.maxi.dm)
-table(selected.maxi)
-
-\dontrun{
-# plot original image
-plot(chmchablais3, main="Initial image")
-
-# plot maxima images, original and first case
-plot(maxi, main="Local maxima")
-plot(selected.maxi, main="Selected maxima")}
-
-}
-\seealso{
-\code{\link{maximaDetection}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plot2Dmatched.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plot2Dmatched.Rd
deleted file mode 100644
index f01d36bb0060f9343c71805ffd781a389ffb706b..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plot2Dmatched.Rd
+++ /dev/null
@@ -1,42 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.match.R
-\name{plot2Dmatched}
-\alias{plot2Dmatched}
-\title{Plot of matched pairs of detected and reference trees}
-\usage{
-plot2Dmatched(lr, ld, matched, chm = NULL, plotBoundary = NULL)
-}
-\arguments{
-\item{lr}{data.frame or matrix. 3D coordinates (X Y Height) of reference positions}
-
-\item{ld}{data.frame or matrix. 3D coordinates (X Y Height) of detected positions}
-
-\item{matched}{data.frame. contains pair indices, typically returned by \code{\link{treeMatching}}}
-
-\item{chm}{raster object. raster for background display}
-
-\item{plotBoundary}{Spatialpolygon. plot boundaries for display}
-}
-\value{
-no return
-}
-\description{
-Plot of matched pairs of detected and reference trees
-}
-\examples{
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# compute matching
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-
-\dontrun{
-# 2D display of matching results
-plot2Dmatched(ref.trees, def.trees, match1)
-plot2Dmatched(ref.trees, def.trees, match2)}
-}
-\seealso{
-\code{\link{treeMatching}}, \code{\link{histDetection}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plotTreeInventory.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plotTreeInventory.Rd
deleted file mode 100644
index dc83d9e80fd386d4de88ed3aed14c8b2c7dd38d0..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/plotTreeInventory.Rd
+++ /dev/null
@@ -1,39 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{plotTreeInventory}
-\alias{plotTreeInventory}
-\title{Displays a map of tree inventory data}
-\usage{
-plotTreeInventory(xy, height = NULL, diam = NULL, species = NULL,
-  add = FALSE)
-}
-\arguments{
-\item{xy}{data.frame. contains two columns with the X, Y  coordinates of tree centers}
-
-\item{height}{vector.  tree heights in meters}
-
-\item{diam}{vector. tree diameters in centimeters}
-
-\item{species}{vector. species abreviation as in \code{\link{speciesColor}} for display with corresponding color.}
-
-\item{add}{boolean. indicates whether points should be added to an existing plot}
-}
-\value{
-no return
-}
-\description{
-displays tree inventory data
-}
-\examples{
-# load tree inventory data from plot Chablais 3
-data("treeinventorychablais3")
-
-\dontrun{
-# display tree inventory
-plotTreeInventory(treeinventorychablais3[,c("x","y")],
-treeinventorychablais3$h,
-species=as.character(treeinventorychablais3$s))}
-}
-\seealso{
-\code{\link{speciesColor}} for a table of species and associated colors
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DSM.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DSM.Rd
deleted file mode 100644
index 37bd9138c0c947d8473c031343dcf53d6d46d7d9..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DSM.Rd
+++ /dev/null
@@ -1,40 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{points2DSM}
-\alias{points2DSM}
-\title{Digital Surface Model}
-\usage{
-points2DSM(.las, res = 1, xmin, xmax, ymin, ymax)
-}
-\arguments{
-\item{.las}{LAS object (e.g. from \code{\link[lidR]{LAS}} function)}
-
-\item{res}{numeric. raster resolution}
-
-\item{xmin}{numeric. lower left corner easting coordinate for output raster.}
-
-\item{xmax}{numeric. upper right corner easting coordinate for output raster.}
-
-\item{ymin}{numeric. lower left corner northing coordinate for output raster.}
-
-\item{ymax}{numeric. upper right corner northing coordinate for output raster.}
-}
-\value{
-A raster object.
-}
-\description{
-Creates a Digital Surface Model from LAS object. Raster extent is specified by the coordinates of lower left and upper right corners. Default extent covers the full range of points, and aligns on multiple values of the resolution. Cell value is the maximum height of points contained in the cell.
-}
-\examples{
-data(laschablais3)
-
-# create digital surface model with first-return points, resolution 0.5 m
-dsm <- points2DSM(lidR::lasfilterfirst(laschablais3), res=0.5)
-
-\dontrun{
-# display raster
-raster::plot(dsm,asp=1)}
-}
-\seealso{
-\code{\link{points2DTM}} for Digital Terrain Model computation.
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DTM.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DTM.Rd
deleted file mode 100644
index 9d8b11593f2d85ffb7460c92adda2ea6a6cc229b..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/points2DTM.Rd
+++ /dev/null
@@ -1,40 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{points2DTM}
-\alias{points2DTM}
-\title{Digital Terrain Model}
-\usage{
-points2DTM(.las, res = 1, xmin, xmax, ymin, ymax)
-}
-\arguments{
-\item{.las}{LAS object (e.g. from \code{\link[lidR]{LAS}} function) containing only ground points}
-
-\item{res}{numeric. raster resolution}
-
-\item{xmin}{numeric. lower left corner easting coordinate for output raster.}
-
-\item{xmax}{numeric. upper right corner easting coordinate for output raster.}
-
-\item{ymin}{numeric. lower left corner northing coordinate for output raster.}
-
-\item{ymax}{numeric. upper right corner northing coordinate for output raster.}
-}
-\value{
-A raster object
-}
-\description{
-Creates a Digital Terrain Model from LAS object. Raster extent is specified by the coordinates of lower left and upper right corners. Default extent covers the full range of points, and aligns on multiple values of the resolution. Cell value is compute as the Delaunay interpolation at the cell center. Relies on the \code{\link[akima]{interp}} function, which is slow, while waiting for new release of \code{\link[lidR]{grid_terrain}} which will integrate an additional argument to specify the output extent.
-}
-\examples{
-data(laschablais3)
-
-# create digital terrain model with points classified as ground
-dtm <- points2DTM(lidR::lasfilter(laschablais3, Classification==2))
-
-\dontrun{
-# display raster
-raster::plot(dtm,asp=1)}
-}
-\seealso{
-\code{\link{points2DSM}} for Digital Surface Model computation.
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/polar2Projected.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/polar2Projected.Rd
deleted file mode 100644
index 3e2fdc48f1820a9636b129843e0e40bb0ee3b326..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/polar2Projected.Rd
+++ /dev/null
@@ -1,52 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{polar2Projected}
-\alias{polar2Projected}
-\title{Polar to cartesian coordinates conversion}
-\usage{
-polar2Projected(x, y, z = 0, azimuth, dist, slope = 0, declination = 0,
-  convergence = 0, diameter = 0)
-}
-\arguments{
-\item{x}{vector. easting coordinates of centers in meter}
-
-\item{y}{vector. northing coordinates of centers in meter}
-
-\item{z}{vector. altitudes of centers in meters}
-
-\item{azimuth}{vector. azimuth values from centers in radian}
-
-\item{dist}{vector. distances between centers and objects in meter}
-
-\item{slope}{vector. slope values from centers in radian}
-
-\item{declination}{vector. magnetic declination values in radian}
-
-\item{convergence}{vector. meridian convergence values in radian}
-
-\item{diameter}{vector. diameters in meter (e.g. in case a radius should be added to the distance)}
-}
-\value{
-A data.frame with easting, northing and altitude coordinates, and horizontal distance from centers to objects centers
-}
-\description{
-Computes projected coordinates (Easting, Northing, Altitude) from polar coordinates (Azimuth, Slope, Distance) and center position (Easting, Northing, Altitude). Magnetic declination and meridian convergence are optional parameters. In case distance is measured to the border of objects (e.g. trees), the diameter can be added to compute the coordinates of object center.
-}
-\examples{
-# create data.frame of trees with polar coordinates and diameters
-trees <- data.frame (x=rep(c(0,10), each=2),
- y = rep(c(0,10),each=2),
- z=rep(c(0,2),each=2),
- azimuth=rep(c(0,pi/3)),
- dist=rep(c(2,4)),
- slope=rep(c(0,pi/6)),
- diameter.cm=c(15,20,25,30))
-trees
- 
- # compute projected coordinates
-polar2Projected(trees$x, trees$y, trees$z, trees$azimuth, trees$dist,
- trees$slope, declination=0.03, convergence=0.02, trees$diameter.cm/200)
-}
-\seealso{
-\code{\link{plotTreeInventory}} for tree inventory display
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterChullMask.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterChullMask.Rd
deleted file mode 100644
index 6b2e05690c75db3831eec3a6ef9605a8dd219954..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterChullMask.Rd
+++ /dev/null
@@ -1,39 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{rasterChullMask}
-\alias{rasterChullMask}
-\title{Raster mask of convex hull}
-\usage{
-rasterChullMask(xy, r)
-}
-\arguments{
-\item{xy}{2 columns matrix or data.frame. xy positions}
-
-\item{r}{raster object. target raster}
-}
-\value{
-a raster with 0 or 1
-}
-\description{
-creates raster mask corresponding to the convex hull of xy positions
-}
-\examples{
-# create raster
-r <- raster::raster()
-raster::extent(r) <- c(0,40,0,40)
-raster::res(r) <- 1
-
-# xy positions
-xy <- data.frame(c(10,20,31.25,15),
-  c(10,20,31.25,25))
-# compute mask
-mask1 <- rasterChullMask(xy, r)
-
-\dontrun{
-# display binary raster
-raster::plot(mask1)
-graphics::points(xy)}
-}
-\seealso{
-\code{\link{rasterXYMask}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterLocalmax.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterLocalmax.Rd
deleted file mode 100644
index 680bc60b7e2216f0f0a5e66f9b2c86de934b9adc..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterLocalmax.Rd
+++ /dev/null
@@ -1,59 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coregistration.R
-\name{rasterLocalmax}
-\alias{rasterLocalmax}
-\title{Statistics of raster local maximum}
-\usage{
-rasterLocalmax(r, dm = 2, med1 = 1, med2 = 2, quanta = 0.75,
-  quantb = 0.5)
-}
-\arguments{
-\item{r}{raster. typically output of \code{\link{rastersMovingCor}}}
-
-\item{dm}{numeric. minimum distance between two local maxima in meters}
-
-\item{med1}{numeric. window radius to compute median value around the maximum position (default: 1m)}
-
-\item{med2}{numeric. window radius #2 to compute median value around the maximum position (default: 2m)}
-
-\item{quanta}{numeric. quantile value to compute for raster values (default: 3rd quartile)}
-
-\item{quantb}{numeric. quantile #2 value to compute for raster values (default: median)}
-}
-\value{
-A data.frame with value of maximum, position of maximum, position of second maximum, ratio of max value to 2nd max, ratio of max value to median of neighborhood (size1 and size 2), ratio of max value to raster quantiles 1 and 2
-}
-\description{
-identifies local maximum from raster (e.g. output from \code{\link{rastersMovingCor}}), and computes related statistics. The second local maximum is the pixel which is local maximum on the largest neighborhood except for the global maximum.
-}
-\examples{
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surfaces
-z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-
-# create small raster
-r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-# offset raster by (-3, -3)
-raster::extent(r.s) <- c(12,22,12,22)
-
-rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-loc.max <- rasterLocalmax(rr)
-loc.max
-
-\dontrun{
-# plot raster
-raster::plot(rr)
-# add location of two local maxima
-points(loc.max[1,c("dx1","dx2")], loc.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3)}
-}
-\seealso{
-\code{\link{rastersMovingCor}}, \code{\link{coregistration}} for application to the coregistration of tree inventory data with canopy height models
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterXYMask.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterXYMask.Rd
deleted file mode 100644
index 19d6d693a2bb7c2adea3471b7e18e341161cdf8a..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasterXYMask.Rd
+++ /dev/null
@@ -1,48 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{rasterXYMask}
-\alias{rasterXYMask}
-\title{Raster mask by union of buffers around xy positions}
-\usage{
-rasterXYMask(xy, buff, r, binary = TRUE)
-}
-\arguments{
-\item{xy}{2 columns matrix or data.frame. xy positions}
-
-\item{buff}{vector.  buffers to apply to the xy positions}
-
-\item{r}{raster object. target raster}
-
-\item{binary}{boolean. should the output mask be boolean (TRUE) or greyscale (FALSE)}
-}
-\value{
-a raster object
-}
-\description{
-creates a raster mask by union of circular buffers around xy positions
-}
-\examples{
-# create raster
-r <- raster::raster()
-raster::extent(r) <- c(0,40,0,40)
-raster::res(r) <- 1
-
-# xy positions
-xy <- data.frame(c(10,20,31.25,15),
-  c(10,20,31.25,25))
-# compute mask
-mask1 <- rasterXYMask(xy, c(5, 8, 5, 5), r)
-mask2 <- rasterXYMask(xy, c(5, 8, 5, 5), r, binary=FALSE)
-
-\dontrun{
-# display binary raster
-raster::plot(mask1)
-graphics::points(xy)
-
-# display distance raster
-raster::plot(mask2)
-graphics::points(xy)}
-}
-\seealso{
-\code{\link{rasterChullMask}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasters2Cor.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasters2Cor.Rd
deleted file mode 100644
index 5386b62f0ff3466abdf6894b6f3b8a8304e9b0d6..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rasters2Cor.Rd
+++ /dev/null
@@ -1,62 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coregistration.R
-\name{rasters2Cor}
-\alias{rasters2Cor}
-\title{Correlation between two rasters}
-\usage{
-rasters2Cor(raster.b, raster.s, mask = NULL, small.SC = TRUE)
-}
-\arguments{
-\item{raster.b}{raster. raster to correlate with largest extent}
-
-\item{raster.s}{raster. raster to correlate with smallest extent}
-
-\item{mask}{raster. mask of area to correlate}
-
-\item{small.SC}{boolean. is the small raster already standardized and centered ?}
-}
-\value{
-A numeric
-}
-\description{
-computes correlation between two rasters, based on the extent of the smallest one.
-}
-\examples{
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surface and noise
-z <- 3*exp(-((xy[,1]-20)^2+(xy[,2]-20)^2/2)/6)
-r.b <- raster::rasterFromXYZ(cbind(xy,z))
-
-# create circular mask of radius 5
-z.mask <- (xy[,1]-20)^2 + (xy[,2]-20)^2 < 5^2
-r.mask <- raster::rasterFromXYZ(cbind(xy, z.mask))
-
-# create small raster of size 20
-r.s <- raster::crop(r.b, raster::extent(c(10,30,10,30)))
-
-# add noise to small raster
-raster::values(r.s) <- raster::values(r.s) + rnorm(length(r.s),0,0.5)
-r.mask <- raster::crop(r.mask, raster::extent(c(10,30,10,30)))
-
-# compute correlation on masked area where signal to noise ratio is lower
-rasters2Cor(r.b, r.s, r.mask, small.SC=FALSE)
-
-# compute correlation for whole small raster
-rasters2Cor(r.b, r.s, small.SC=FALSE)
-
-\dontrun{
-# display large raster
-raster::plot(r.b, main="Large raster")
-# display small raster
-raster::plot(r.s, main="Small raster")
-# display mask
-raster::plot(r.mask, main="Computation mask")}
-}
-\seealso{
-\code{\link{rastersMovingCor}} to compute correlation between rasters for different translations
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rastersMovingCor.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rastersMovingCor.Rd
deleted file mode 100644
index 934b80281f075216abc0de5a40ef5d317665a649..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/rastersMovingCor.Rd
+++ /dev/null
@@ -1,59 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/coregistration.R
-\name{rastersMovingCor}
-\alias{rastersMovingCor}
-\title{Correlation between rasters for different XY translations}
-\usage{
-rastersMovingCor(raster.b, raster.s, mask = NULL, buffer = 19, pas = 0.5)
-}
-\arguments{
-\item{raster.b}{raster. raster to correlate with largest extent}
-
-\item{raster.s}{raster. raster to correlate with smallest extent}
-
-\item{mask}{raster. mask of area to correlate, applied to small raster}
-
-\item{buffer}{numeric. radius of the circular buffer area for possible translations}
-
-\item{pas}{numeric. increment step of translations within buffer area to compute correlation values, should be a multiple of raster resolution}
-}
-\value{
-A raster. Raster value at coordinates x,y correspond to the correlation between the large raster and the small raster when small raster center has been translated of (x,y)
-}
-\description{
-computes correlation between two rasters for different XY translations. The correlation values are computed on the extent of the smallest raster using \code{\link{rasters2Cor}}, after applying an optional mask, and for each translation within a buffer area.
-}
-\examples{
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surfaces
-z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-
-# create small raster
-r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-# offset raster by (-3, -3)
-raster::extent(r.s) <- c(12,22,12,22)
-
-# compute correlations for translations inside buffer
-rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-rr
-
-\dontrun{
-# display large raster
-raster::plot(r.b)
-# display small raster
-raster::plot(r.s)
-# display correlation
-raster::plot(rr, xlab="X translation", ylab="Y translation",
-main="Correlation between rasters")}
-}
-\seealso{
-\code{\link{rasterLocalmax}} to extract local maximum of resulting correlation raster, \code{\link{rasters2Cor}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segAdjust.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segAdjust.Rd
deleted file mode 100644
index 519ff64811b2ebb79d5f5b262c12067ee4796e12..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segAdjust.Rd
+++ /dev/null
@@ -1,65 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{segAdjust}
-\alias{segAdjust}
-\title{Modification of segments based on values}
-\usage{
-segAdjust(dem.w, dem.wh, dem.nl, prop = 0.3, min.value = 2,
-  min.maxvalue = 5)
-}
-\arguments{
-\item{dem.w}{cimg object. image with segments id, without 0 values}
-
-\item{dem.wh}{cimg object. image with max value inside segment}
-
-\item{dem.nl}{cimg object. image with initial values}
-
-\item{prop}{numeric. proportional threshold for removal of pixels which initial values are lower than the max height of the segment (\code{dem.nl < prop x dem.wh})}
-
-\item{min.value}{numeric. threshold for removel of pixels which initial values are lower (\code{dem.nl < min.value})}
-
-\item{min.maxvalue}{numeric. threshold for complete removal of segments which maximum value height is smaller to the threshold (\code{dem.wh < min.maxvalue})}
-}
-\value{
-A cimg object: image with modified segments.
-}
-\description{
-in a segmented image, removes from segments the pixels which values in a reference image is below a certain percentage of the highest value inside the segment. Removed pixels are attributed 0 value.
-}
-\examples{
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# median filter
-chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-
-# maxima detection and selection
-maxi <- maximaDetection(chmchablais3, resolution)
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# segmentation
-seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-
-# segmentation modification
-seg.modif1 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
- chmchablais3, prop=0.5)
-seg.modif2 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
- chmchablais3, prop=0, min.value=5, min.maxvalue=10)
-
-\dontrun{
-# plot initial segmented image
-plot(seg.selected.maxi$id \%\% 8, main="Initial segments")
-plot(seg.modif1 \%\% 8, main="Modified segments 1")
-plot(seg.modif2 \%\% 8, main="Modified segments 2")}
-
-}
-\seealso{
-\code{\link{maximaDetection}}, \code{\link{maximaSelection}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segmentation.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segmentation.Rd
deleted file mode 100644
index 6ce2da2f3018949b91ce19e0110f5793b011dbcf..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/segmentation.Rd
+++ /dev/null
@@ -1,56 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{segmentation}
-\alias{segmentation}
-\title{Image segmentation by seed-based watershed algorithm}
-\usage{
-segmentation(maxi, dem.nl)
-}
-\arguments{
-\item{maxi}{cimg object. image with seed points (e.g. from \code{\link{maximaDetection}} or \code{\link{maximaSelection}} )}
-
-\item{dem.nl}{cimg object. image for seed propagation (typically initial image used for maxima detection).}
-}
-\value{
-A list of 2 cimg objects (image of segments id, image of maximum value in segment)
-}
-\description{
-performs a seed-based watershed segmentation and outputs two images: one with segment id and one where the segments are filled with the highest value of the segment in the initial image
-}
-\examples{
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# median filter
-chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-# maxima selection
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# segmentation
-seg.maxi <- segmentation(maxi, chmchablais3)
-seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-
-\dontrun{
-# plot original image
-plot(chmchablais3, main="Median filter")
-
-# plot segmented image
-plot(seg.maxi$id \%\% 8, main="Segments, no maxima selection")
-plot(seg.selected.maxi$id \%\% 8, main="Segments, maxima selection")
-plot(seg.selected.maxi$maxvalue, main="Max value in segment, maxima selection")}
-
-}
-\seealso{
-\code{\link{maximaDetection}}, \code{\link{maximaSelection}}, \code{\link{segAdjust}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/speciesColor.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/speciesColor.Rd
deleted file mode 100644
index 1efbecfb4c3aa679b6e6d4e197da4ab7802a299c..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/speciesColor.Rd
+++ /dev/null
@@ -1,23 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/common.R
-\name{speciesColor}
-\alias{speciesColor}
-\title{Table of species names, abreviations and display colors}
-\usage{
-speciesColor()
-}
-\value{
-A data frame with species name, color, coniferous (C) / broadleaf (B) type, and name abreviation GESP of GEnus and SPecies
-}
-\description{
-table for species names, abreviations and type (coniferous/broadleaf), and display color
-}
-\examples{
-# load table
-tab.species <- speciesColor()
-head(tab.species)
-summary(tab.species)
-}
-\seealso{
-\code{\link{plotTreeInventory}} for tree inventory display
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeExtraction.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeExtraction.Rd
deleted file mode 100644
index bb99a9f4d82e96f1c33d642f7a2d1ee71c3cf4d3..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeExtraction.Rd
+++ /dev/null
@@ -1,48 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{treeExtraction}
-\alias{treeExtraction}
-\title{Tree extraction}
-\usage{
-treeExtraction(r.dem.nl, r.maxi, r.dem.w, r.mask = NULL)
-}
-\arguments{
-\item{r.dem.nl}{raster object. raster of canopy height model, preferably filtered to avoid effect of holes on volume and surface computation}
-
-\item{r.maxi}{raster object. raster positive values at local maxima}
-
-\item{r.dem.w}{raster object. segmented raster}
-
-\item{r.mask}{raster object. only segments which maxima are inside the mask are extracted}
-}
-\value{
-A data.frame with tree id, local maximum stats (height, coordinates, dominance radius), surface and volume.
-}
-\description{
-creates a dataframe with segment id, height and coordinates of maxima, surface and volume, computed from three images: initial, local maxima and segmented, typically obtained with \code{\link{treeSegmentation}}
-}
-\examples{
-data(chmchablais3)
-
-# tree segmentation
-segments <- treeSegmentation(chmchablais3)
-
-# tree extraction
-trees <- treeExtraction(segments$filled.dem, segments$local.maxima, segments$segments.id)
-summary(trees)
-
-\dontrun{
-# plot initial image
-plot(chmchablais3)
-
-#' add segment contours
-contours <- raster::rasterToPolygons(segments$segments.id, dissolve=T)
-plot(contours, add=T, border="white")
-
-# add treetop positions
-points(trees$x, trees$y, cex=trees$h/20)}
- 
-}
-\seealso{
-\code{\link{treeSegmentation}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeMatching.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeMatching.Rd
deleted file mode 100644
index 0c51dfa6bd53a25475e61435d0d03a1990d7a9e6..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeMatching.Rd
+++ /dev/null
@@ -1,49 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.match.R
-\name{treeMatching}
-\alias{treeMatching}
-\title{3D matching of detected tree top positions with reference positions}
-\usage{
-treeMatching(lr, ld, deltaGround = 2.1, hPrec = 0.14, computeStat = TRUE)
-}
-\arguments{
-\item{lr}{data.frame or matrix. 3D coordinates (X Y Height) of reference positions}
-
-\item{ld}{data.frame or matrix. 3D coordinates (X Y Height) of detected positions}
-
-\item{deltaGround}{numeric. buffer around trunk position}
-
-\item{hPrec}{numeric. buffer around apex position (reference Height)}
-
-\item{computeStat}{boolean. should matching stats be computed}
-}
-\value{
-A dataframe with matched pairs (row of reference positions in first column, and row of detected positions in second column) and corresponding 3D distances
-}
-\description{
-First computes a matching index for each potential pair associating a detected with a reference tree. This index is the 3D distance between detected and reference points, divided by a maximum matching distance set by user-defined parameters. Pairs with the lowest index are then iteratively associated.
-}
-\examples{
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# match trees
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-match1
-match2
-
-\dontrun{
-# 2D display of matching result
-plot2Dmatched(ref.trees, def.trees, match1)
-plot2Dmatched(ref.trees, def.trees, match2)}
-}
-\references{
-Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 53-55 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-
-Monnet, J.-M., Mermin, E., Chanussot, J., Berger, F. 2010. Tree top detection using local maxima filtering: a parameter sensitivity analysis. Silvilaser 2010, the 10th International Conference on LiDAR Applications for Assessing Forest Ecosystems, September 14-17, Freiburg, Germany, 9 p. \url{https://hal.archives-ouvertes.fr/hal-00523245/document}
-}
-\seealso{
-\code{\link{plot2Dmatched}}, \code{\link{histDetection}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeSegmentation.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeSegmentation.Rd
deleted file mode 100644
index 073c4eebbf67e2a9b9754e05a770604fd09f6d63..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeSegmentation.Rd
+++ /dev/null
@@ -1,66 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/tree.detection.R
-\name{treeSegmentation}
-\alias{treeSegmentation}
-\title{Preprocessing and segmentation of raster image for tree identification}
-\usage{
-treeSegmentation(dem, nlFilter = "Closing", nlSize = 5, sigma = 0.3,
-  dmin = 0, dprop = 0.05, hmin = 5, propHouppier = 0.3,
-  minHouppier = 2)
-}
-\arguments{
-\item{dem}{raster object or string indicating location of raster file (typically a canopy height model)}
-
-\item{nlFilter}{string. specifies the non-linear filter for image pre-processing, should be an option of function \code{\link{demFiltering}}}
-
-\item{nlSize}{numeric. width of kernel of non-linear filter in pixels}
-
-\item{sigma}{numeric or matrix. if a single number is provided, sigmap is the standard deviation of Gaussian filter in meters, 0 corresponds to no smoothing. In case of matrix, the first column corresponds to the standard deviation of the filter, and the second to thresholds for image values (e.g. a filter of standard deviation specified in line \code{i} is applied to pixels in image which values are between thresholds indicated in lines \code{i} and \code{i+1}). Threshold values should be ordered in increasing order.}
-
-\item{dmin}{numeric. treetop minimum distance to next higher pixel in meters}
-
-\item{dprop}{numeric. number defining the treetop minimum distance as proportion of height to next higher pixel}
-
-\item{hmin}{numeric. minimum treetop height}
-
-\item{propHouppier}{numeric. minimum height of tree crown as proportion of treetop height}
-
-\item{minHouppier}{numeric. minimum crown height}
-}
-\value{
-A list of 4 rasters: selected local maxima (values = distance to higher pixel), segments, non-linear preprocessed dem, smoothed preprocessed dem
-}
-\description{
-global function for preprocessing (filtering), maxima detection and selection, segmentation and segmentation adjustment of a raster image.
-}
-\examples{
-data(chmchablais3)
-
-# tree segmentation
-segments <- treeSegmentation(chmchablais3)
-segments2<- treeSegmentation(chmchablais3, nlFilter="Median", nlSize=3,
-  sigma=cbind(c(0.2,0.8), c(0,15)),dmin=0,dprop=0,hmin=10,propHouppier=0.5,minHouppier=5)
-
-\dontrun{
-# plot initial image segments
-plot(chmchablais3, main="Initial image")
-plot(segments$smoothed.dem, main="Filtered image")
-plot(segments$local.maxima, main="Local maxima")
-#
-# replace segment with id 0 (not a tree) with NA
-segments$segments[segments$segments==0] <- NA
-plot(segments$segments \%\% 8 , main="Segments")
-#
-# plot segmentation with other parameters
-segments2$segments[segments2$segments==0] <- NA
-plot(segments2$segments \%\% 8, main="Segments2")}
-
-}
-\references{
-Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. Section 6.2 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-
-Monnet, J.-M., Mermin, E., Chanussot, J., Berger, F. 2010. Tree top detection using local maxima filtering: a parameter sensitivity analysis. Silvilaser 2010, the 10th International Conference on LiDAR Applications for Assessing Forest Ecosystems, September 14-17, Freiburg, Germany, 9 p. \url{https://hal.archives-ouvertes.fr/hal-00523245/document}
-}
-\seealso{
-\code{\link{demFiltering}}, \code{\link{maximaDetection}}, \code{\link{maximaDetection}}, \code{\link{maximaSelection}}, \code{\link{segmentation}}, \code{\link{segAdjust}}, \code{\link{treeExtraction}}
-}
diff --git a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeinventorychablais3.Rd b/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeinventorychablais3.Rd
deleted file mode 100644
index cc112d34fb3add368d96b02978423d1ba057cbe1..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00_pkg_src/lidaRtRee/man/treeinventorychablais3.Rd
+++ /dev/null
@@ -1,31 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/treeinventorychablais3-data.R
-\docType{data}
-\name{treeinventorychablais3}
-\alias{treeinventorychablais3}
-\title{Tree inventory data in France (Chablais 3 plot, July 2010)}
-\format{A dataframe with columns:
-\enumerate{
-\item x easting coordinate in Lambert 93
-\item y northing coordinate in Lambert 93
-\item d dbh (cm)
-\item h tree height (m)
-\item n tree number
-\item s species abreviated as GESP (GEnus SPecies)
-\item e appearance (0: missing or lying, 1: normal, 2: broken treetop, 3: dead with branches, 4: snag)
-\item t tilted (0: no, 1: yes)
-}}
-\usage{
-data(treeinventorychablais3)
-}
-\description{
-All trees with diameter at breast height >= 7.5 cm are inventoried on a 50m x 50m plot.
-}
-\examples{
-data(treeinventorychablais3)
-summary(treeinventorychablais3)
-}
-\references{
-Monnet, J.-M. 2011. Using airborne laser scanning for mountain forests mapping: Support vector regression for stand parameters estimation and unsupervised training for treetop detection. Ph.D. thesis. University of Grenoble, France. pp. 21-22 & 34 \url{https://tel.archives-ouvertes.fr/tel-00652698/document}
-}
-\keyword{datasets}
diff --git a/lidaRtRee.Rcheck/00check.log b/lidaRtRee.Rcheck/00check.log
deleted file mode 100644
index ffd6a626d202241e57e5d0670384274194561dd5..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00check.log
+++ /dev/null
@@ -1,61 +0,0 @@
-* using log directory ‘/media/data/R/packages/lidaRtRee/lidaRtRee.Rcheck’
-* using R version 3.4.4 (2018-03-15)
-* using platform: x86_64-pc-linux-gnu (64-bit)
-* using session charset: UTF-8
-* using option ‘--as-cran’
-* checking for file ‘lidaRtRee/DESCRIPTION’ ... OK
-* this is package ‘lidaRtRee’ version ‘1.0’
-* checking CRAN incoming feasibility ... NOTE
-Maintainer: ‘Jean-Matthieu Monnet <jean-matthieu.monnet@irstea.fr>’
-
-New submission
-
-Package has a FOSS license but eventually depends on the following
-package which restricts use:
-  akima
-* checking package namespace information ... OK
-* checking package dependencies ... OK
-* checking if this is a source package ... OK
-* checking if there is a namespace ... OK
-* checking for executable files ... OK
-* checking for hidden files and directories ... OK
-* checking for portable file names ... OK
-* checking for sufficient/correct file permissions ... OK
-* checking whether package ‘lidaRtRee’ can be installed ... OK
-* checking installed package size ... OK
-* checking package directory ... OK
-* checking DESCRIPTION meta-information ... OK
-* checking top-level files ... OK
-* checking for left-over files ... OK
-* checking index information ... OK
-* checking package subdirectories ... OK
-* checking R files for non-ASCII characters ... OK
-* checking R files for syntax errors ... OK
-* checking whether the package can be loaded ... OK
-* checking whether the package can be loaded with stated dependencies ... OK
-* checking whether the package can be unloaded cleanly ... OK
-* checking whether the namespace can be loaded with stated dependencies ... OK
-* checking whether the namespace can be unloaded cleanly ... OK
-* checking loading without being on the library search path ... OK
-* checking use of S3 registration ... OK
-* checking dependencies in R code ... OK
-* checking S3 generic/method consistency ... OK
-* checking replacement functions ... OK
-* checking foreign function calls ... OK
-* checking R code for possible problems ... OK
-* checking Rd files ... OK
-* checking Rd metadata ... OK
-* checking Rd line widths ... OK
-* checking Rd cross-references ... OK
-* checking for missing documentation entries ... OK
-* checking for code/documentation mismatches ... OK
-* checking Rd \usage sections ... OK
-* checking Rd contents ... OK
-* checking for unstated dependencies in examples ... OK
-* checking contents of ‘data’ directory ... OK
-* checking data for non-ASCII characters ... OK
-* checking data for ASCII and uncompressed saves ... OK
-* checking examples ... OK
-* checking PDF version of manual ... OK
-* DONE
-Status: 1 NOTE
diff --git a/lidaRtRee.Rcheck/00install.out b/lidaRtRee.Rcheck/00install.out
deleted file mode 100644
index 38832f7576ddeefc9b7cb016273d16376bd888d3..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/00install.out
+++ /dev/null
@@ -1,10 +0,0 @@
-* installing *source* package ‘lidaRtRee’ ...
-** R
-** data
-*** moving datasets to lazyload DB
-** preparing package for lazy loading
-** help
-*** installing help indices
-** building package indices
-** testing if installed package can be loaded
-* DONE (lidaRtRee)
diff --git a/lidaRtRee.Rcheck/lidaRtRee-Ex.R b/lidaRtRee.Rcheck/lidaRtRee-Ex.R
deleted file mode 100644
index 3c97e96346d0be16fda083adf1d86d2f52097375..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee-Ex.R
+++ /dev/null
@@ -1,995 +0,0 @@
-pkgname <- "lidaRtRee"
-source(file.path(R.home("share"), "R", "examples-header.R"))
-options(warn = 1)
-base::assign(".ExTimings", "lidaRtRee-Ex.timings", pos = 'CheckExEnv')
-base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
-base::assign(".format_ptime",
-function(x) {
-  if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L]
-  if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L]
-  options(OutDec = '.')
-  format(x[1L:3L], digits = 7L)
-},
-pos = 'CheckExEnv')
-
-### * </HEADER>
-library('lidaRtRee')
-
-base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
-cleanEx()
-nameEx("chmchablais3")
-### * chmchablais3
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: chmchablais3
-### Title: Canopy height model (Chablais 3 plot)
-### Aliases: chmchablais3
-### Keywords: datasets
-
-### ** Examples
-
-data(chmchablais3)
-chmchablais3
-## Not run: 
-##D raster::plot(chmchablais3)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("chmchablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("circle2Raster")
-### * circle2Raster
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: circle2Raster
-### Title: Raster corresponding to circle extent
-### Aliases: circle2Raster
-
-### ** Examples
-
-circle2Raster(100, 100, 20, 1, 5)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("circle2Raster", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("coregistration")
-### * coregistration
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: coregistration
-### Title: Tree inventory and canopy height model coregistration
-### Aliases: coregistration
-
-### ** Examples
-
-# tree inventory
-trees <- data.frame(x=c(22.2, 18.3, 18.1), y =c(22.1, 22.7, 18.4), z=c(15,10,15))
-
-# mask of inventory area
-# empty raster with extent
-tree.mask <- circle2Raster(20, 20, 9, resolution=1)
-# fill binary mask
-tree.mask <- rasterXYMask(rbind(c(20, 20), c(20, 20)), c(9,9), tree.mask, binary=TRUE)
-
-# simulate chm raster
-chm <- raster::raster()
-raster::extent(chm) <- c(0,40,0,40)
-raster::res(chm) <- 1
-xy <- raster::xyFromCell(chm,1:length(chm))
-
-# add Gaussian surfaces to simulate tree crowns
-z1 <- trees$z[1]*exp(-((xy[,1]-trees$x[1])^2+(xy[,2]-trees$y[1])^2/2)*trees$z[1]/50)
-z2 <- trees$z[2]*exp(-((xy[,1]-trees$x[2])^2+(xy[,2]-trees$y[2])^2/2)*trees$z[2]/50)
-z3 <- trees$z[3]*exp(-((xy[,1]-trees$x[3])^2+(xy[,2]-trees$y[3])^2/2)*trees$z[3]/50)
-chm <- raster::rasterFromXYZ(cbind(xy,pmax(z1,z2,z3)))#+rnorm(length(z1),0,1)))
-
-# translate trees
-trees$x <- trees$x-2
-trees$y <- trees$y+4
-
-coregistration <- coregistration(chm, trees, mask=tree.mask, buffer=8, pas=1, dm=1, plot=TRUE)
-coregistration$local.max[,c("dx1", "dy1")]
-
-## Not run: 
-##D # plot raster
-##D raster::plot(coregistration$correlation.raster)
-##D abline(h=0, lty=2)
-##D abline(v=0, lty=2)
-##D # add location of two local maxima
-##D points(coregistration$local.max[1,c("dx1","dx2")],
-##D coregistration$local.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3, col="red")
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("coregistration", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("createDisk")
-### * createDisk
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: createDisk
-### Title: Disk-shaped matrix mask
-### Aliases: createDisk
-
-### ** Examples
-
-createDisk(7)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("createDisk", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("demFiltering")
-### * demFiltering
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: demFiltering
-### Title: Image pre-processing (non-linear filtering and Gaussian
-###   smoothing)
-### Aliases: demFiltering
-
-### ** Examples
-
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# filtering with median and Gaussian smoothing
-im <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0.8)
-
-# filtering with median filter and value-dependent Gaussian smoothing
-# (less smoothing for values between 0 and 15)
-im2 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=cbind(c(0.2,0.8), c(0,15)))
-
-## Not run: 
-##D # plot original image
-##D plot(chmchablais3, main="Initial image")
-##D 
-##D # plot image after median filter
-##D plot(im$non.linear.image, main="Median filter")
-##D 
-##D # plot image after median and Gaussian filters
-##D plot(im$smoothed.image, main="Smoothed image")
-##D 
-##D # plot image after median and value-dependent Gaussian filters
-##D plot(im2$smoothed.image, main="Value-dependent smoothing")
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("demFiltering", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("heightRegression")
-### * heightRegression
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: heightRegression
-### Title: Regression of detected heights VS reference heights
-### Aliases: heightRegression
-
-### ** Examples
-
-# create tree locations and heights
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-
-# tree matching
-match1 <- treeMatching(ref.trees, def.trees)
-
-# height regression
-reg <- heightRegression(ref.trees, def.trees, match1, plot=FALSE, 
-  species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30))
-summary(reg$lm)
-reg$stats
-
-## Not run: 
-##D # display plot
-##D reg <- heightRegression(ref.trees, def.trees, match1, 
-##D   species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30), plot=TRUE)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("heightRegression", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("histDetection")
-### * histDetection
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: histDetection
-### Title: Histogram of detection
-### Aliases: histDetection
-
-### ** Examples
-
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# tree matching with different buffer size
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-#
-# corresponding number of detections
-histDetection(ref.trees, def.trees, match1, plot=FALSE)
-histDetection(ref.trees, def.trees, match2, plot=FALSE)
-
-## Not run: 
-##D # 2D display of matching result
-##D histDetection(ref.trees, def.trees, match1)
-##D histDetection(ref.trees, def.trees, match2)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("histDetection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("laschablais3")
-### * laschablais3
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: laschablais3
-### Title: las data in France (Chablais 3 plot)
-### Aliases: laschablais3
-### Keywords: datasets
-
-### ** Examples
-
-data(laschablais3)
-laschablais3
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("laschablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("maximaDetection")
-### * maximaDetection
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: maximaDetection
-### Title: Local maxima extraction on image
-### Aliases: maximaDetection
-
-### ** Examples
-
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-## Not run: 
-##D # plot original image
-##D plot(chmchablais3, main="Initial image")
-##D 
-##D # plot maxima image
-##D plot(maxi, main="Local maxima")
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("maximaDetection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("maximaSelection")
-### * maximaSelection
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: maximaSelection
-### Title: Image maxima selection based on values and neighborhood of local
-###   maxima
-### Aliases: maximaSelection
-
-### ** Examples
-
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-# several maxima selection settings
-selected.maxi.hmin <- maximaSelection(maxi, chmchablais3, hmin=15)
-selected.maxi.dm <- maximaSelection(maxi, chmchablais3, dm=2.5)
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# corresponding count number of remaining maxima
-table(maxi)
-table(selected.maxi.hmin)
-table(selected.maxi.dm)
-table(selected.maxi)
-
-## Not run: 
-##D # plot original image
-##D plot(chmchablais3, main="Initial image")
-##D 
-##D # plot maxima images, original and first case
-##D plot(maxi, main="Local maxima")
-##D plot(selected.maxi, main="Selected maxima")
-## End(Not run)
-
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("maximaSelection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("plot2Dmatched")
-### * plot2Dmatched
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: plot2Dmatched
-### Title: Plot of matched pairs of detected and reference trees
-### Aliases: plot2Dmatched
-
-### ** Examples
-
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# compute matching
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-
-## Not run: 
-##D # 2D display of matching results
-##D plot2Dmatched(ref.trees, def.trees, match1)
-##D plot2Dmatched(ref.trees, def.trees, match2)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("plot2Dmatched", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("plotTreeInventory")
-### * plotTreeInventory
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: plotTreeInventory
-### Title: Displays a map of tree inventory data
-### Aliases: plotTreeInventory
-
-### ** Examples
-
-# load tree inventory data from plot Chablais 3
-data("treeinventorychablais3")
-
-## Not run: 
-##D # display tree inventory
-##D plotTreeInventory(treeinventorychablais3[,c("x","y")],
-##D treeinventorychablais3$h,
-##D species=as.character(treeinventorychablais3$s))
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("plotTreeInventory", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("points2DSM")
-### * points2DSM
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: points2DSM
-### Title: Digital Surface Model
-### Aliases: points2DSM
-
-### ** Examples
-
-data(laschablais3)
-
-# create digital surface model with first-return points, resolution 0.5 m
-dsm <- points2DSM(lidR::lasfilterfirst(laschablais3), res=0.5)
-
-## Not run: 
-##D # display raster
-##D raster::plot(dsm,asp=1)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("points2DSM", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("points2DTM")
-### * points2DTM
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: points2DTM
-### Title: Digital Terrain Model
-### Aliases: points2DTM
-
-### ** Examples
-
-data(laschablais3)
-
-# create digital terrain model with points classified as ground
-dtm <- points2DTM(lidR::lasfilter(laschablais3, Classification==2))
-
-## Not run: 
-##D # display raster
-##D raster::plot(dtm,asp=1)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("points2DTM", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("polar2Projected")
-### * polar2Projected
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: polar2Projected
-### Title: Polar to cartesian coordinates conversion
-### Aliases: polar2Projected
-
-### ** Examples
-
-# create data.frame of trees with polar coordinates and diameters
-trees <- data.frame (x=rep(c(0,10), each=2),
- y = rep(c(0,10),each=2),
- z=rep(c(0,2),each=2),
- azimuth=rep(c(0,pi/3)),
- dist=rep(c(2,4)),
- slope=rep(c(0,pi/6)),
- diameter.cm=c(15,20,25,30))
-trees
- 
- # compute projected coordinates
-polar2Projected(trees$x, trees$y, trees$z, trees$azimuth, trees$dist,
- trees$slope, declination=0.03, convergence=0.02, trees$diameter.cm/200)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("polar2Projected", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("rasterChullMask")
-### * rasterChullMask
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: rasterChullMask
-### Title: Raster mask of convex hull
-### Aliases: rasterChullMask
-
-### ** Examples
-
-# create raster
-r <- raster::raster()
-raster::extent(r) <- c(0,40,0,40)
-raster::res(r) <- 1
-
-# xy positions
-xy <- data.frame(c(10,20,31.25,15),
-  c(10,20,31.25,25))
-# compute mask
-mask1 <- rasterChullMask(xy, r)
-
-## Not run: 
-##D # display binary raster
-##D raster::plot(mask1)
-##D graphics::points(xy)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("rasterChullMask", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("rasterLocalmax")
-### * rasterLocalmax
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: rasterLocalmax
-### Title: Statistics of raster local maximum
-### Aliases: rasterLocalmax
-
-### ** Examples
-
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surfaces
-z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-
-# create small raster
-r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-# offset raster by (-3, -3)
-raster::extent(r.s) <- c(12,22,12,22)
-
-rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-loc.max <- rasterLocalmax(rr)
-loc.max
-
-## Not run: 
-##D # plot raster
-##D raster::plot(rr)
-##D # add location of two local maxima
-##D points(loc.max[1,c("dx1","dx2")], loc.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("rasterLocalmax", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("rasterXYMask")
-### * rasterXYMask
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: rasterXYMask
-### Title: Raster mask by union of buffers around xy positions
-### Aliases: rasterXYMask
-
-### ** Examples
-
-# create raster
-r <- raster::raster()
-raster::extent(r) <- c(0,40,0,40)
-raster::res(r) <- 1
-
-# xy positions
-xy <- data.frame(c(10,20,31.25,15),
-  c(10,20,31.25,25))
-# compute mask
-mask1 <- rasterXYMask(xy, c(5, 8, 5, 5), r)
-mask2 <- rasterXYMask(xy, c(5, 8, 5, 5), r, binary=FALSE)
-
-## Not run: 
-##D # display binary raster
-##D raster::plot(mask1)
-##D graphics::points(xy)
-##D 
-##D # display distance raster
-##D raster::plot(mask2)
-##D graphics::points(xy)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("rasterXYMask", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("rasters2Cor")
-### * rasters2Cor
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: rasters2Cor
-### Title: Correlation between two rasters
-### Aliases: rasters2Cor
-
-### ** Examples
-
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surface and noise
-z <- 3*exp(-((xy[,1]-20)^2+(xy[,2]-20)^2/2)/6)
-r.b <- raster::rasterFromXYZ(cbind(xy,z))
-
-# create circular mask of radius 5
-z.mask <- (xy[,1]-20)^2 + (xy[,2]-20)^2 < 5^2
-r.mask <- raster::rasterFromXYZ(cbind(xy, z.mask))
-
-# create small raster of size 20
-r.s <- raster::crop(r.b, raster::extent(c(10,30,10,30)))
-
-# add noise to small raster
-raster::values(r.s) <- raster::values(r.s) + rnorm(length(r.s),0,0.5)
-r.mask <- raster::crop(r.mask, raster::extent(c(10,30,10,30)))
-
-# compute correlation on masked area where signal to noise ratio is lower
-rasters2Cor(r.b, r.s, r.mask, small.SC=FALSE)
-
-# compute correlation for whole small raster
-rasters2Cor(r.b, r.s, small.SC=FALSE)
-
-## Not run: 
-##D # display large raster
-##D raster::plot(r.b, main="Large raster")
-##D # display small raster
-##D raster::plot(r.s, main="Small raster")
-##D # display mask
-##D raster::plot(r.mask, main="Computation mask")
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("rasters2Cor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("rastersMovingCor")
-### * rastersMovingCor
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: rastersMovingCor
-### Title: Correlation between rasters for different XY translations
-### Aliases: rastersMovingCor
-
-### ** Examples
-
-# create raster
-r.b <- raster::raster()
-raster::extent(r.b) <- c(0,40,0,40)
-raster::res(r.b) <- 1
-xy <- raster::xyFromCell(r.b,1:length(r.b))
-
-# add Gaussian surfaces
-z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-
-# create small raster
-r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-# offset raster by (-3, -3)
-raster::extent(r.s) <- c(12,22,12,22)
-
-# compute correlations for translations inside buffer
-rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-rr
-
-## Not run: 
-##D # display large raster
-##D raster::plot(r.b)
-##D # display small raster
-##D raster::plot(r.s)
-##D # display correlation
-##D raster::plot(rr, xlab="X translation", ylab="Y translation",
-##D main="Correlation between rasters")
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("rastersMovingCor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("segAdjust")
-### * segAdjust
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: segAdjust
-### Title: Modification of segments based on values
-### Aliases: segAdjust
-
-### ** Examples
-
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# median filter
-chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-
-# maxima detection and selection
-maxi <- maximaDetection(chmchablais3, resolution)
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# segmentation
-seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-
-# segmentation modification
-seg.modif1 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
- chmchablais3, prop=0.5)
-seg.modif2 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
- chmchablais3, prop=0, min.value=5, min.maxvalue=10)
-
-## Not run: 
-##D # plot initial segmented image
-##D plot(seg.selected.maxi$id %% 8, main="Initial segments")
-##D plot(seg.modif1 %% 8, main="Modified segments 1")
-##D plot(seg.modif2 %% 8, main="Modified segments 2")
-## End(Not run)
-
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("segAdjust", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("segmentation")
-### * segmentation
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: segmentation
-### Title: Image segmentation by seed-based watershed algorithm
-### Aliases: segmentation
-
-### ** Examples
-
-data(chmchablais3)
-# fill NA values
-chmchablais3[is.na(chmchablais3)] <- 0
-
-# record raster resolution
-resolution <- raster::res(chmchablais3)[1]
-
-# convert raster to cimg
-chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-
-# median filter
-chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-
-# maxima detection
-maxi <- maximaDetection(chmchablais3, resolution)
-
-# maxima selection
-selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-
-# segmentation
-seg.maxi <- segmentation(maxi, chmchablais3)
-seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-
-## Not run: 
-##D # plot original image
-##D plot(chmchablais3, main="Median filter")
-##D 
-##D # plot segmented image
-##D plot(seg.maxi$id %% 8, main="Segments, no maxima selection")
-##D plot(seg.selected.maxi$id %% 8, main="Segments, maxima selection")
-##D plot(seg.selected.maxi$maxvalue, main="Max value in segment, maxima selection")
-## End(Not run)
-
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("segmentation", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("speciesColor")
-### * speciesColor
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: speciesColor
-### Title: Table of species names, abreviations and display colors
-### Aliases: speciesColor
-
-### ** Examples
-
-# load table
-tab.species <- speciesColor()
-head(tab.species)
-summary(tab.species)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("speciesColor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("treeExtraction")
-### * treeExtraction
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: treeExtraction
-### Title: Tree extraction
-### Aliases: treeExtraction
-
-### ** Examples
-
-data(chmchablais3)
-
-# tree segmentation
-segments <- treeSegmentation(chmchablais3)
-
-# tree extraction
-trees <- treeExtraction(segments$filled.dem, segments$local.maxima, segments$segments.id)
-summary(trees)
-
-## Not run: 
-##D # plot initial image
-##D plot(chmchablais3)
-##D 
-##D #' add segment contours
-##D contours <- raster::rasterToPolygons(segments$segments.id, dissolve=T)
-##D plot(contours, add=T, border="white")
-##D 
-##D # add treetop positions
-##D points(trees$x, trees$y, cex=trees$h/20)
-## End(Not run)
- 
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("treeExtraction", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("treeMatching")
-### * treeMatching
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: treeMatching
-### Title: 3D matching of detected tree top positions with reference
-###   positions
-### Aliases: treeMatching
-
-### ** Examples
-
-# create reference and detected trees
-ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-#
-# match trees
-match1 <- treeMatching(ref.trees, def.trees)
-match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-match1
-match2
-
-## Not run: 
-##D # 2D display of matching result
-##D plot2Dmatched(ref.trees, def.trees, match1)
-##D plot2Dmatched(ref.trees, def.trees, match2)
-## End(Not run)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("treeMatching", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("treeSegmentation")
-### * treeSegmentation
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: treeSegmentation
-### Title: Preprocessing and segmentation of raster image for tree
-###   identification
-### Aliases: treeSegmentation
-
-### ** Examples
-
-data(chmchablais3)
-
-# tree segmentation
-segments <- treeSegmentation(chmchablais3)
-segments2<- treeSegmentation(chmchablais3, nlFilter="Median", nlSize=3,
-  sigma=cbind(c(0.2,0.8), c(0,15)),dmin=0,dprop=0,hmin=10,propHouppier=0.5,minHouppier=5)
-
-## Not run: 
-##D # plot initial image segments
-##D plot(chmchablais3, main="Initial image")
-##D plot(segments$smoothed.dem, main="Filtered image")
-##D plot(segments$local.maxima, main="Local maxima")
-##D #
-##D # replace segment with id 0 (not a tree) with NA
-##D segments$segments[segments$segments==0] <- NA
-##D plot(segments$segments %% 8 , main="Segments")
-##D #
-##D # plot segmentation with other parameters
-##D segments2$segments[segments2$segments==0] <- NA
-##D plot(segments2$segments %% 8, main="Segments2")
-## End(Not run)
-
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("treeSegmentation", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-cleanEx()
-nameEx("treeinventorychablais3")
-### * treeinventorychablais3
-
-flush(stderr()); flush(stdout())
-
-base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-### Name: treeinventorychablais3
-### Title: Tree inventory data in France (Chablais 3 plot, July 2010)
-### Aliases: treeinventorychablais3
-### Keywords: datasets
-
-### ** Examples
-
-data(treeinventorychablais3)
-summary(treeinventorychablais3)
-
-
-
-base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-base::cat("treeinventorychablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-### * <FOOTER>
-###
-options(digits = 7L)
-base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
-grDevices::dev.off()
-###
-### Local variables: ***
-### mode: outline-minor ***
-### outline-regexp: "\\(> \\)?### [*]+" ***
-### End: ***
-quit('no')
diff --git a/lidaRtRee.Rcheck/lidaRtRee-Ex.Rout b/lidaRtRee.Rcheck/lidaRtRee-Ex.Rout
deleted file mode 100644
index 466608660f373d7b1fd30be182f20c39d0f84c9c..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee-Ex.Rout
+++ /dev/null
@@ -1,1242 +0,0 @@
-
-R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
-Copyright (C) 2018 The R Foundation for Statistical Computing
-Platform: x86_64-pc-linux-gnu (64-bit)
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-  Natural language support but running in an English locale
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> pkgname <- "lidaRtRee"
-> source(file.path(R.home("share"), "R", "examples-header.R"))
-> options(warn = 1)
-> base::assign(".ExTimings", "lidaRtRee-Ex.timings", pos = 'CheckExEnv')
-> base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
-> base::assign(".format_ptime",
-+ function(x) {
-+   if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L]
-+   if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L]
-+   options(OutDec = '.')
-+   format(x[1L:3L], digits = 7L)
-+ },
-+ pos = 'CheckExEnv')
-> 
-> ### * </HEADER>
-> library('lidaRtRee')
-> 
-> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
-> cleanEx()
-> nameEx("chmchablais3")
-> ### * chmchablais3
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: chmchablais3
-> ### Title: Canopy height model (Chablais 3 plot)
-> ### Aliases: chmchablais3
-> ### Keywords: datasets
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> chmchablais3
-Loading required package: raster
-Loading required package: sp
-class       : RasterLayer 
-dimensions  : 144, 144, 20736  (nrow, ncol, ncell)
-resolution  : 0.5, 0.5  (x, y)
-extent      : 974331, 974403, 6581625, 6581697  (xmin, xmax, ymin, ymax)
-coord. ref. : +init=epsg:2154 +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs 
-> ## Not run: 
-> ##D raster::plot(chmchablais3)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("chmchablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-
-detaching ‘package:raster’, ‘package:sp’
-
-> nameEx("circle2Raster")
-> ### * circle2Raster
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: circle2Raster
-> ### Title: Raster corresponding to circle extent
-> ### Aliases: circle2Raster
-> 
-> ### ** Examples
-> 
-> circle2Raster(100, 100, 20, 1, 5)
-class       : RasterLayer 
-dimensions  : 50, 50, 2500  (nrow, ncol, ncell)
-resolution  : 1, 1  (x, y)
-extent      : 75, 125, 75, 125  (xmin, xmax, ymin, ymax)
-coord. ref. : NA 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("circle2Raster", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("coregistration")
-> ### * coregistration
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: coregistration
-> ### Title: Tree inventory and canopy height model coregistration
-> ### Aliases: coregistration
-> 
-> ### ** Examples
-> 
-> # tree inventory
-> trees <- data.frame(x=c(22.2, 18.3, 18.1), y =c(22.1, 22.7, 18.4), z=c(15,10,15))
-> 
-> # mask of inventory area
-> # empty raster with extent
-> tree.mask <- circle2Raster(20, 20, 9, resolution=1)
-> # fill binary mask
-> tree.mask <- rasterXYMask(rbind(c(20, 20), c(20, 20)), c(9,9), tree.mask, binary=TRUE)
-> 
-> # simulate chm raster
-> chm <- raster::raster()
-> raster::extent(chm) <- c(0,40,0,40)
-> raster::res(chm) <- 1
-> xy <- raster::xyFromCell(chm,1:length(chm))
-> 
-> # add Gaussian surfaces to simulate tree crowns
-> z1 <- trees$z[1]*exp(-((xy[,1]-trees$x[1])^2+(xy[,2]-trees$y[1])^2/2)*trees$z[1]/50)
-> z2 <- trees$z[2]*exp(-((xy[,1]-trees$x[2])^2+(xy[,2]-trees$y[2])^2/2)*trees$z[2]/50)
-> z3 <- trees$z[3]*exp(-((xy[,1]-trees$x[3])^2+(xy[,2]-trees$y[3])^2/2)*trees$z[3]/50)
-> chm <- raster::rasterFromXYZ(cbind(xy,pmax(z1,z2,z3)))#+rnorm(length(z1),0,1)))
-> 
-> # translate trees
-> trees$x <- trees$x-2
-> trees$y <- trees$y+4
-> 
-> coregistration <- coregistration(chm, trees, mask=tree.mask, buffer=8, pas=1, dm=1, plot=TRUE)
-> coregistration$local.max[,c("dx1", "dy1")]
-  dx1 dy1
-1   2  -4
-> 
-> ## Not run: 
-> ##D # plot raster
-> ##D raster::plot(coregistration$correlation.raster)
-> ##D abline(h=0, lty=2)
-> ##D abline(v=0, lty=2)
-> ##D # add location of two local maxima
-> ##D points(coregistration$local.max[1,c("dx1","dx2")],
-> ##D coregistration$local.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3, col="red")
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("coregistration", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("createDisk")
-> ### * createDisk
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: createDisk
-> ### Title: Disk-shaped matrix mask
-> ### Aliases: createDisk
-> 
-> ### ** Examples
-> 
-> createDisk(7)
-      [,1]  [,2]  [,3] [,4]  [,5]  [,6]  [,7]
-[1,] FALSE FALSE FALSE TRUE FALSE FALSE FALSE
-[2,] FALSE  TRUE  TRUE TRUE  TRUE  TRUE FALSE
-[3,] FALSE  TRUE  TRUE TRUE  TRUE  TRUE FALSE
-[4,]  TRUE  TRUE  TRUE TRUE  TRUE  TRUE  TRUE
-[5,] FALSE  TRUE  TRUE TRUE  TRUE  TRUE FALSE
-[6,] FALSE  TRUE  TRUE TRUE  TRUE  TRUE FALSE
-[7,] FALSE FALSE FALSE TRUE FALSE FALSE FALSE
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("createDisk", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("demFiltering")
-> ### * demFiltering
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: demFiltering
-> ### Title: Image pre-processing (non-linear filtering and Gaussian
-> ###   smoothing)
-> ### Aliases: demFiltering
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> # fill NA values
-> chmchablais3[is.na(chmchablais3)] <- 0
-> 
-> # convert raster to cimg
-> chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-> 
-> # filtering with median and Gaussian smoothing
-> im <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0.8)
-> 
-> # filtering with median filter and value-dependent Gaussian smoothing
-> # (less smoothing for values between 0 and 15)
-> im2 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=cbind(c(0.2,0.8), c(0,15)))
-> 
-> ## Not run: 
-> ##D # plot original image
-> ##D plot(chmchablais3, main="Initial image")
-> ##D 
-> ##D # plot image after median filter
-> ##D plot(im$non.linear.image, main="Median filter")
-> ##D 
-> ##D # plot image after median and Gaussian filters
-> ##D plot(im$smoothed.image, main="Smoothed image")
-> ##D 
-> ##D # plot image after median and value-dependent Gaussian filters
-> ##D plot(im2$smoothed.image, main="Value-dependent smoothing")
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("demFiltering", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("heightRegression")
-> ### * heightRegression
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: heightRegression
-> ### Title: Regression of detected heights VS reference heights
-> ### Aliases: heightRegression
-> 
-> ### ** Examples
-> 
-> # create tree locations and heights
-> ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-> def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-> 
-> # tree matching
-> match1 <- treeMatching(ref.trees, def.trees)
-> 
-> # height regression
-> reg <- heightRegression(ref.trees, def.trees, match1, plot=FALSE, 
-+   species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30))
-> summary(reg$lm)
-
-Call:
-stats::lm(formula = Hm ~ Hl, data = app)
-
-Residuals:
-      1       2       3       4 
--1.9526  0.1611 -0.2180  2.0095 
-
-Coefficients:
-            Estimate Std. Error t value Pr(>|t|)  
-(Intercept)   1.5592     4.1631   0.375   0.7440  
-Hl            0.9621     0.2741   3.510   0.0724 .
----
-Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
-
-Residual standard error: 1.99 on 2 degrees of freedom
-Multiple R-squared:  0.8604,	Adjusted R-squared:  0.7906 
-F-statistic: 12.32 on 1 and 2 DF,  p-value: 0.07244
-
-> reg$stats
-$rmse
-[1] 2
-
-$bias
-[1] -1
-
-$sd
-[1] 1.632993
-
-> 
-> ## Not run: 
-> ##D # display plot
-> ##D reg <- heightRegression(ref.trees, def.trees, match1, 
-> ##D   species=c("ABAL", "ABAL", "FASY", "FASY", "ABAL"), limits=c(0,30), plot=TRUE)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("heightRegression", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("histDetection")
-> ### * histDetection
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: histDetection
-> ### Title: Histogram of detection
-> ### Aliases: histDetection
-> 
-> ### ** Examples
-> 
-> # create reference and detected trees
-> ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-> def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-> #
-> # tree matching with different buffer size
-> match1 <- treeMatching(ref.trees, def.trees)
-> match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-> #
-> # corresponding number of detections
-> histDetection(ref.trees, def.trees, match1, plot=FALSE)
-$true.detections
-[1] 4
-
-$false.detections
-[1] 0
-
-$omissions
-[1] 1
-
-> histDetection(ref.trees, def.trees, match2, plot=FALSE)
-$true.detections
-[1] 3
-
-$false.detections
-[1] 1
-
-$omissions
-[1] 2
-
-> 
-> ## Not run: 
-> ##D # 2D display of matching result
-> ##D histDetection(ref.trees, def.trees, match1)
-> ##D histDetection(ref.trees, def.trees, match2)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("histDetection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("laschablais3")
-> ### * laschablais3
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: laschablais3
-> ### Title: las data in France (Chablais 3 plot)
-> ### Aliases: laschablais3
-> ### Keywords: datasets
-> 
-> ### ** Examples
-> 
-> data(laschablais3)
-> laschablais3
-Loading required package: lidR
-Loading required package: magrittr
-An object of class "LAS"
-Slot "data":
-              X       Y       Z  gpstime Intensity ReturnNumber NumberOfReturns
-    1: 974407.8 6581702 1381.33 29216.35        15            2               2
-    2: 974406.7 6581702 1386.73 29216.36        27            1               2
-    3: 974407.8 6581701 1373.60 29216.36        46            2               2
-    4: 974407.2 6581701 1387.49 29216.36        57            1               1
-    5: 974407.7 6581701 1387.42 29216.36        24            1               2
-   ---                                                                         
-90997: 974329.0 6581620 1368.64 52961.46        12            1               2
-90998: 974329.4 6581620 1363.51 52961.46        13            2               3
-90999: 974330.1 6581620 1365.85 52961.46        18            1               2
-91000: 974330.7 6581620 1369.87 52961.46        26            1               2
-91001: 974330.9 6581620 1367.06 52961.46        14            2               2
-       ScanDirectionFlag EdgeOfFlightline Classification ScanAngle UserData
-    1:                 0                0              4         0        0
-    2:                 0                0              4         0        0
-    3:                 0                0              4         0        0
-    4:                 0                0              4         0        0
-    5:                 0                0              4         0        0
-   ---                                                                     
-90997:                 0                0             15         0        0
-90998:                 0                0             15         0        0
-90999:                 0                0             15         0        0
-91000:                 0                0             15         0        0
-91001:                 0                0             15         0        0
-       PointSourceID
-    1:         25043
-    2:         25043
-    3:         25043
-    4:         25043
-    5:         25043
-   ---              
-90997:         24055
-90998:         24055
-90999:         24055
-91000:         24055
-91001:         24055
-
-Slot "header":
-File signature:           LASF 
-File source ID:           0 
-Global encoding:          0 
-Project ID - GUID:        0 
-Version:                  1.2
-System identifier:         
-Generating software:      TerraScan 
-File creation d/y:        282/2017
-header size:              227 
-Offset to point data:     227 
-Num. var. length record:  0 
-Point data format:        1 
-Point data record length: 28 
-Num. of point records:    91001 
-Num. of points by return: 64041 26960 0 0 0 
-Scale factor X Y Z:       0.01 0.01 0.01 
-Offset X Y Z:             0 0 0 
-min X Y Z:                974326 6581620 1346.38 
-max X Y Z:                974408 6581702 1408.38 
-Variable length records:  void
-
-Slot "crs":
-CRS arguments: NA 
-
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("laschablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-
-detaching ‘package:lidR’, ‘package:magrittr’
-
-> nameEx("maximaDetection")
-> ### * maximaDetection
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: maximaDetection
-> ### Title: Local maxima extraction on image
-> ### Aliases: maximaDetection
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> # fill NA values
-> chmchablais3[is.na(chmchablais3)] <- 0
-> 
-> # record raster resolution
-> resolution <- raster::res(chmchablais3)[1]
-> 
-> # convert raster to cimg
-> chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-> 
-> # maxima detection
-> maxi <- maximaDetection(chmchablais3, resolution)
-> 
-> ## Not run: 
-> ##D # plot original image
-> ##D plot(chmchablais3, main="Initial image")
-> ##D 
-> ##D # plot maxima image
-> ##D plot(maxi, main="Local maxima")
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("maximaDetection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("maximaSelection")
-> ### * maximaSelection
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: maximaSelection
-> ### Title: Image maxima selection based on values and neighborhood of local
-> ###   maxima
-> ### Aliases: maximaSelection
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> # fill NA values
-> chmchablais3[is.na(chmchablais3)] <- 0
-> 
-> # record raster resolution
-> resolution <- raster::res(chmchablais3)[1]
-> 
-> # convert raster to cimg
-> chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-> 
-> # maxima detection
-> maxi <- maximaDetection(chmchablais3, resolution)
-> 
-> # several maxima selection settings
-> selected.maxi.hmin <- maximaSelection(maxi, chmchablais3, hmin=15)
-> selected.maxi.dm <- maximaSelection(maxi, chmchablais3, dm=2.5)
-> selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-> 
-> # corresponding count number of remaining maxima
-> table(maxi)
-maxi
-    0     1   1.5     2   2.5     3   3.5     4   4.5     5   5.5 
-19721   792    82    39    22    13     9     8     6     7    37 
-> table(selected.maxi.hmin)
-selected.maxi.hmin
-    0     1   1.5     2   2.5     3   3.5     4   4.5     5   5.5 
-20268   330    32    21    12     8     7     8     6     7    37 
-> table(selected.maxi.dm)
-selected.maxi.dm
-    0   2.5     3   3.5     4   4.5     5   5.5 
-20634    22    13     9     8     6     7    37 
-> table(selected.maxi)
-selected.maxi
-    0     1   1.5     2   2.5     3   3.5     4   4.5     5   5.5 
-20617     2    21    11    10     8     9     8     6     7    37 
-> 
-> ## Not run: 
-> ##D # plot original image
-> ##D plot(chmchablais3, main="Initial image")
-> ##D 
-> ##D # plot maxima images, original and first case
-> ##D plot(maxi, main="Local maxima")
-> ##D plot(selected.maxi, main="Selected maxima")
-> ## End(Not run)
-> 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("maximaSelection", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("plot2Dmatched")
-> ### * plot2Dmatched
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: plot2Dmatched
-> ### Title: Plot of matched pairs of detected and reference trees
-> ### Aliases: plot2Dmatched
-> 
-> ### ** Examples
-> 
-> # create reference and detected trees
-> ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-> def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-> #
-> # compute matching
-> match1 <- treeMatching(ref.trees, def.trees)
-> match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-> 
-> ## Not run: 
-> ##D # 2D display of matching results
-> ##D plot2Dmatched(ref.trees, def.trees, match1)
-> ##D plot2Dmatched(ref.trees, def.trees, match2)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("plot2Dmatched", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("plotTreeInventory")
-> ### * plotTreeInventory
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: plotTreeInventory
-> ### Title: Displays a map of tree inventory data
-> ### Aliases: plotTreeInventory
-> 
-> ### ** Examples
-> 
-> # load tree inventory data from plot Chablais 3
-> data("treeinventorychablais3")
-> 
-> ## Not run: 
-> ##D # display tree inventory
-> ##D plotTreeInventory(treeinventorychablais3[,c("x","y")],
-> ##D treeinventorychablais3$h,
-> ##D species=as.character(treeinventorychablais3$s))
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("plotTreeInventory", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("points2DSM")
-> ### * points2DSM
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: points2DSM
-> ### Title: Digital Surface Model
-> ### Aliases: points2DSM
-> 
-> ### ** Examples
-> 
-> data(laschablais3)
-> 
-> # create digital surface model with first-return points, resolution 0.5 m
-> dsm <- points2DSM(lidR::lasfilterfirst(laschablais3), res=0.5)
-> 
-> ## Not run: 
-> ##D # display raster
-> ##D raster::plot(dsm,asp=1)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("points2DSM", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("points2DTM")
-> ### * points2DTM
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: points2DTM
-> ### Title: Digital Terrain Model
-> ### Aliases: points2DTM
-> 
-> ### ** Examples
-> 
-> data(laschablais3)
-> 
-> # create digital terrain model with points classified as ground
-> dtm <- points2DTM(lidR::lasfilter(laschablais3, Classification==2))
-> 
-> ## Not run: 
-> ##D # display raster
-> ##D raster::plot(dtm,asp=1)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("points2DTM", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("polar2Projected")
-> ### * polar2Projected
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: polar2Projected
-> ### Title: Polar to cartesian coordinates conversion
-> ### Aliases: polar2Projected
-> 
-> ### ** Examples
-> 
-> # create data.frame of trees with polar coordinates and diameters
-> trees <- data.frame (x=rep(c(0,10), each=2),
-+  y = rep(c(0,10),each=2),
-+  z=rep(c(0,2),each=2),
-+  azimuth=rep(c(0,pi/3)),
-+  dist=rep(c(2,4)),
-+  slope=rep(c(0,pi/6)),
-+  diameter.cm=c(15,20,25,30))
-> trees
-   x  y z  azimuth dist     slope diameter.cm
-1  0  0 0 0.000000    2 0.0000000          15
-2  0  0 0 1.047198    4 0.5235988          20
-3 10 10 2 0.000000    2 0.0000000          25
-4 10 10 2 1.047198    4 0.5235988          30
->  
->  # compute projected coordinates
-> polar2Projected(trees$x, trees$y, trees$z, trees$azimuth, trees$dist,
-+  trees$slope, declination=0.03, convergence=0.02, trees$diameter.cm/200)
-           x         y      z        d
-1  0.1018326  2.034954 0.0375 2.037500
-2  3.1273139  1.602753 2.0500 3.514102
-3 10.1030820 12.059922 2.0625 2.062500
-4 13.1495622 11.614156 4.0750 3.539102
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("polar2Projected", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("rasterChullMask")
-> ### * rasterChullMask
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: rasterChullMask
-> ### Title: Raster mask of convex hull
-> ### Aliases: rasterChullMask
-> 
-> ### ** Examples
-> 
-> # create raster
-> r <- raster::raster()
-> raster::extent(r) <- c(0,40,0,40)
-> raster::res(r) <- 1
-> 
-> # xy positions
-> xy <- data.frame(c(10,20,31.25,15),
-+   c(10,20,31.25,25))
-> # compute mask
-> mask1 <- rasterChullMask(xy, r)
-> 
-> ## Not run: 
-> ##D # display binary raster
-> ##D raster::plot(mask1)
-> ##D graphics::points(xy)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("rasterChullMask", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("rasterLocalmax")
-> ### * rasterLocalmax
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: rasterLocalmax
-> ### Title: Statistics of raster local maximum
-> ### Aliases: rasterLocalmax
-> 
-> ### ** Examples
-> 
-> # create raster
-> r.b <- raster::raster()
-> raster::extent(r.b) <- c(0,40,0,40)
-> raster::res(r.b) <- 1
-> xy <- raster::xyFromCell(r.b,1:length(r.b))
-> 
-> # add Gaussian surfaces
-> z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-> z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-> z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-> r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-> 
-> # create small raster
-> r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-> # offset raster by (-3, -3)
-> raster::extent(r.s) <- c(12,22,12,22)
-> 
-> rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-> loc.max <- rasterLocalmax(rr)
-> loc.max
-  max1 dx1 dy1 dx2 dy2 ratiomax1max2 rmedloc1 rmedloc2  rquanta   rquantb
-1 0.99   3   3  -1  -2      1.488124  1.20767  1.67097 4.732568 -7.805455
-> 
-> ## Not run: 
-> ##D # plot raster
-> ##D raster::plot(rr)
-> ##D # add location of two local maxima
-> ##D points(loc.max[1,c("dx1","dx2")], loc.max[1,c("dy1","dy2")], cex=c(1,0.5), pch=3)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("rasterLocalmax", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("rasterXYMask")
-> ### * rasterXYMask
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: rasterXYMask
-> ### Title: Raster mask by union of buffers around xy positions
-> ### Aliases: rasterXYMask
-> 
-> ### ** Examples
-> 
-> # create raster
-> r <- raster::raster()
-> raster::extent(r) <- c(0,40,0,40)
-> raster::res(r) <- 1
-> 
-> # xy positions
-> xy <- data.frame(c(10,20,31.25,15),
-+   c(10,20,31.25,25))
-> # compute mask
-> mask1 <- rasterXYMask(xy, c(5, 8, 5, 5), r)
-> mask2 <- rasterXYMask(xy, c(5, 8, 5, 5), r, binary=FALSE)
-> 
-> ## Not run: 
-> ##D # display binary raster
-> ##D raster::plot(mask1)
-> ##D graphics::points(xy)
-> ##D 
-> ##D # display distance raster
-> ##D raster::plot(mask2)
-> ##D graphics::points(xy)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("rasterXYMask", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("rasters2Cor")
-> ### * rasters2Cor
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: rasters2Cor
-> ### Title: Correlation between two rasters
-> ### Aliases: rasters2Cor
-> 
-> ### ** Examples
-> 
-> # create raster
-> r.b <- raster::raster()
-> raster::extent(r.b) <- c(0,40,0,40)
-> raster::res(r.b) <- 1
-> xy <- raster::xyFromCell(r.b,1:length(r.b))
-> 
-> # add Gaussian surface and noise
-> z <- 3*exp(-((xy[,1]-20)^2+(xy[,2]-20)^2/2)/6)
-> r.b <- raster::rasterFromXYZ(cbind(xy,z))
-> 
-> # create circular mask of radius 5
-> z.mask <- (xy[,1]-20)^2 + (xy[,2]-20)^2 < 5^2
-> r.mask <- raster::rasterFromXYZ(cbind(xy, z.mask))
-> 
-> # create small raster of size 20
-> r.s <- raster::crop(r.b, raster::extent(c(10,30,10,30)))
-> 
-> # add noise to small raster
-> raster::values(r.s) <- raster::values(r.s) + rnorm(length(r.s),0,0.5)
-> r.mask <- raster::crop(r.mask, raster::extent(c(10,30,10,30)))
-> 
-> # compute correlation on masked area where signal to noise ratio is lower
-> rasters2Cor(r.b, r.s, r.mask, small.SC=FALSE)
-[1] 0.9124299
-> 
-> # compute correlation for whole small raster
-> rasters2Cor(r.b, r.s, small.SC=FALSE)
-[1] 0.7062636
-> 
-> ## Not run: 
-> ##D # display large raster
-> ##D raster::plot(r.b, main="Large raster")
-> ##D # display small raster
-> ##D raster::plot(r.s, main="Small raster")
-> ##D # display mask
-> ##D raster::plot(r.mask, main="Computation mask")
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("rasters2Cor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("rastersMovingCor")
-> ### * rastersMovingCor
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: rastersMovingCor
-> ### Title: Correlation between rasters for different XY translations
-> ### Aliases: rastersMovingCor
-> 
-> ### ** Examples
-> 
-> # create raster
-> r.b <- raster::raster()
-> raster::extent(r.b) <- c(0,40,0,40)
-> raster::res(r.b) <- 1
-> xy <- raster::xyFromCell(r.b,1:length(r.b))
-> 
-> # add Gaussian surfaces
-> z1 <- 1.5*exp(-((xy[,1]-22)^2+(xy[,2]-22)^2/2)/5)
-> z2 <- exp(-((xy[,1]-20)^2+(xy[,2]-22)^2/2)/3)
-> z3 <- 1.5*exp(-((xy[,1]-17)^2+(xy[,2]-17)^2/2)/5)
-> r.b <- raster::rasterFromXYZ(cbind(xy,z1+z2+z3))
-> 
-> # create small raster
-> r.s <- raster::crop(r.b, raster::extent(c(15,25,15,25)))
-> # offset raster by (-3, -3)
-> raster::extent(r.s) <- c(12,22,12,22)
-> 
-> # compute correlations for translations inside buffer
-> rr <- rastersMovingCor(r.b, r.s, buffer=9, pas=1)
-> rr
-class       : RasterLayer 
-dimensions  : 19, 19, 361  (nrow, ncol, ncell)
-resolution  : 1, 1  (x, y)
-extent      : -9.5, 9.5, -9.5, 9.5  (xmin, xmax, ymin, ymax)
-coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
-data source : in memory
-names       : layer 
-values      : -0.5045176, 0.99  (min, max)
-
-> 
-> ## Not run: 
-> ##D # display large raster
-> ##D raster::plot(r.b)
-> ##D # display small raster
-> ##D raster::plot(r.s)
-> ##D # display correlation
-> ##D raster::plot(rr, xlab="X translation", ylab="Y translation",
-> ##D main="Correlation between rasters")
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("rastersMovingCor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("segAdjust")
-> ### * segAdjust
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: segAdjust
-> ### Title: Modification of segments based on values
-> ### Aliases: segAdjust
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> # fill NA values
-> chmchablais3[is.na(chmchablais3)] <- 0
-> 
-> # record raster resolution
-> resolution <- raster::res(chmchablais3)[1]
-> 
-> # convert raster to cimg
-> chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-> 
-> # median filter
-> chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-> 
-> # maxima detection and selection
-> maxi <- maximaDetection(chmchablais3, resolution)
-> selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-> 
-> # segmentation
-> seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-> 
-> # segmentation modification
-> seg.modif1 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
-+  chmchablais3, prop=0.5)
-> seg.modif2 <- segAdjust(seg.selected.maxi$id, seg.selected.maxi$maxvalue,
-+  chmchablais3, prop=0, min.value=5, min.maxvalue=10)
-> 
-> ## Not run: 
-> ##D # plot initial segmented image
-> ##D plot(seg.selected.maxi$id %% 8, main="Initial segments")
-> ##D plot(seg.modif1 %% 8, main="Modified segments 1")
-> ##D plot(seg.modif2 %% 8, main="Modified segments 2")
-> ## End(Not run)
-> 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("segAdjust", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("segmentation")
-> ### * segmentation
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: segmentation
-> ### Title: Image segmentation by seed-based watershed algorithm
-> ### Aliases: segmentation
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> # fill NA values
-> chmchablais3[is.na(chmchablais3)] <- 0
-> 
-> # record raster resolution
-> resolution <- raster::res(chmchablais3)[1]
-> 
-> # convert raster to cimg
-> chmchablais3 <- imager::as.cimg(raster::as.matrix(chmchablais3))
-> 
-> # median filter
-> chmchablais3 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3, sigmap=0)[[1]]
-> 
-> # maxima detection
-> maxi <- maximaDetection(chmchablais3, resolution)
-> 
-> # maxima selection
-> selected.maxi <- maximaSelection(maxi, chmchablais3, dm=1, dprop=0.1)
-> 
-> # segmentation
-> seg.maxi <- segmentation(maxi, chmchablais3)
-> seg.selected.maxi <- segmentation(selected.maxi, chmchablais3)
-> 
-> ## Not run: 
-> ##D # plot original image
-> ##D plot(chmchablais3, main="Median filter")
-> ##D 
-> ##D # plot segmented image
-> ##D plot(seg.maxi$id %% 8, main="Segments, no maxima selection")
-> ##D plot(seg.selected.maxi$id %% 8, main="Segments, maxima selection")
-> ##D plot(seg.selected.maxi$maxvalue, main="Max value in segment, maxima selection")
-> ## End(Not run)
-> 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("segmentation", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("speciesColor")
-> ### * speciesColor
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: speciesColor
-> ### Title: Table of species names, abreviations and display colors
-> ### Aliases: speciesColor
-> 
-> ### ** Examples
-> 
-> # load table
-> tab.species <- speciesColor()
-> head(tab.species)
-                    name     col broad.conif abvr
-ABAL          Abies alba  purple           C ABAL
-AC                  Acer  orange           B   AC
-ACCA      Acer campestre orange1           B ACCA
-ACOP         Acer opalus orange2           B ACOP
-ACPL    Acer platanoides orange3           B ACPL
-ACPS Acer pseudoplatanus orange4           B ACPS
-> summary(tab.species)
-     name               col            broad.conif     abvr          
- Length:60          Length:60          B   :46     Length:60         
- Class :character   Class :character   C   :13     Class :character  
- Mode  :character   Mode  :character   NA's: 1     Mode  :character  
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("speciesColor", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("treeExtraction")
-> ### * treeExtraction
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: treeExtraction
-> ### Title: Tree extraction
-> ### Aliases: treeExtraction
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> 
-> # tree segmentation
-> segments <- treeSegmentation(chmchablais3)
-> 
-> # tree extraction
-> trees <- treeExtraction(segments$filled.dem, segments$local.maxima, segments$segments.id)
-> summary(trees)
-       id               x                y                 h         
- Min.   :  1.00   Min.   :974332   Min.   :6581626   Min.   : 6.249  
- 1st Qu.: 34.50   1st Qu.:974345   1st Qu.:6581647   1st Qu.:15.495  
- Median : 66.00   Median :974361   Median :6581663   Median :19.624  
- Mean   : 68.26   Mean   :974364   Mean   :6581663   Mean   :19.117  
- 3rd Qu.:102.50   3rd Qu.:974379   3rd Qu.:6581681   3rd Qu.:23.228  
- Max.   :139.00   Max.   :974402   Max.   :6581697   Max.   :29.888  
-   dom.radius          s                v           
- Min.   :1.000   Min.   :  1.50   Min.   :   9.158  
- 1st Qu.:2.000   1st Qu.: 21.38   1st Qu.: 257.285  
- Median :3.500   Median : 30.00   Median : 421.138  
- Mean   :3.433   Mean   : 33.21   Mean   : 500.415  
- 3rd Qu.:5.500   3rd Qu.: 43.50   3rd Qu.: 687.130  
- Max.   :5.500   Max.   :103.75   Max.   :1878.524  
-> 
-> ## Not run: 
-> ##D # plot initial image
-> ##D plot(chmchablais3)
-> ##D 
-> ##D #' add segment contours
-> ##D contours <- raster::rasterToPolygons(segments$segments.id, dissolve=T)
-> ##D plot(contours, add=T, border="white")
-> ##D 
-> ##D # add treetop positions
-> ##D points(trees$x, trees$y, cex=trees$h/20)
-> ## End(Not run)
->  
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("treeExtraction", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("treeMatching")
-> ### * treeMatching
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: treeMatching
-> ### Title: 3D matching of detected tree top positions with reference
-> ###   positions
-> ### Aliases: treeMatching
-> 
-> ### ** Examples
-> 
-> # create reference and detected trees
-> ref.trees <- cbind(c(1,4,3,4,2), c(1,1,2,3,4), c(15,18,20,10,11))
-> def.trees <- cbind(c(2,2,4,4), c(1,3,4,1), c(16,19,9,15))
-> #
-> # match trees
-> match1 <- treeMatching(ref.trees, def.trees)
-> match2 <- treeMatching(ref.trees, def.trees, deltaGround=2, hPrec=0)
-> match1
-  r d h.diff plan.diff
-1 1 1      1  1.000000
-2 3 2     -1  1.414214
-3 4 3     -1  1.000000
-4 2 4     -3  0.000000
-> match2
-  r d h.diff plan.diff
-1 1 1      1  1.000000
-2 4 3     -1  1.000000
-3 3 2     -1  1.414214
-> 
-> ## Not run: 
-> ##D # 2D display of matching result
-> ##D plot2Dmatched(ref.trees, def.trees, match1)
-> ##D plot2Dmatched(ref.trees, def.trees, match2)
-> ## End(Not run)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("treeMatching", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("treeSegmentation")
-> ### * treeSegmentation
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: treeSegmentation
-> ### Title: Preprocessing and segmentation of raster image for tree
-> ###   identification
-> ### Aliases: treeSegmentation
-> 
-> ### ** Examples
-> 
-> data(chmchablais3)
-> 
-> # tree segmentation
-> segments <- treeSegmentation(chmchablais3)
-> segments2<- treeSegmentation(chmchablais3, nlFilter="Median", nlSize=3,
-+   sigma=cbind(c(0.2,0.8), c(0,15)),dmin=0,dprop=0,hmin=10,propHouppier=0.5,minHouppier=5)
-> 
-> ## Not run: 
-> ##D # plot initial image segments
-> ##D plot(chmchablais3, main="Initial image")
-> ##D plot(segments$smoothed.dem, main="Filtered image")
-> ##D plot(segments$local.maxima, main="Local maxima")
-> ##D #
-> ##D # replace segment with id 0 (not a tree) with NA
-> ##D segments$segments[segments$segments==0] <- NA
-> ##D plot(segments$segments %% 8 , main="Segments")
-> ##D #
-> ##D # plot segmentation with other parameters
-> ##D segments2$segments[segments2$segments==0] <- NA
-> ##D plot(segments2$segments %% 8, main="Segments2")
-> ## End(Not run)
-> 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("treeSegmentation", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("treeinventorychablais3")
-> ### * treeinventorychablais3
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: treeinventorychablais3
-> ### Title: Tree inventory data in France (Chablais 3 plot, July 2010)
-> ### Aliases: treeinventorychablais3
-> ### Keywords: datasets
-> 
-> ### ** Examples
-> 
-> data(treeinventorychablais3)
-> summary(treeinventorychablais3)
-       x                y                 d               h        
- Min.   :974341   Min.   :6581634   Min.   : 5.50   Min.   : 1.60  
- 1st Qu.:974354   1st Qu.:6581651   1st Qu.:12.07   1st Qu.:10.30  
- Median :974364   Median :6581660   Median :16.95   Median :14.70  
- Mean   :974365   Mean   :6581662   Mean   :22.33   Mean   :14.87  
- 3rd Qu.:974376   3rd Qu.:6581674   3rd Qu.:30.88   3rd Qu.:19.60  
- Max.   :974393   Max.   :6581687   Max.   :62.20   Max.   :31.10  
-                                                                   
-       n                s            e               t          
- Min.   :  1.00   FASY   :47   Min.   :1.000   Min.   :0.00000  
- 1st Qu.: 28.25   PIAB   :29   1st Qu.:1.000   1st Qu.:0.00000  
- Median : 55.50   ABAL   :21   Median :1.000   Median :0.00000  
- Mean   : 55.50   ACPS   : 4   Mean   :1.036   Mean   :0.01818  
- 3rd Qu.: 82.75   FREX   : 2   3rd Qu.:1.000   3rd Qu.:0.00000  
- Max.   :110.00   SOAU   : 2   Max.   :3.000   Max.   :1.00000  
-                  (Other): 5                                    
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("treeinventorychablais3", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> ### * <FOOTER>
-> ###
-> options(digits = 7L)
-> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  14 0.032 14.033 0 0 
-> grDevices::dev.off()
-null device 
-          1 
-> ###
-> ### Local variables: ***
-> ### mode: outline-minor ***
-> ### outline-regexp: "\\(> \\)?### [*]+" ***
-> ### End: ***
-> quit('no')
diff --git a/lidaRtRee.Rcheck/lidaRtRee-Ex.pdf b/lidaRtRee.Rcheck/lidaRtRee-Ex.pdf
deleted file mode 100644
index 63389554e5d8f1fae50aa0a09f2744bfddfe48f4..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee-Ex.pdf and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee-Ex.timings b/lidaRtRee.Rcheck/lidaRtRee-Ex.timings
deleted file mode 100644
index 0dd118643ac42afc7e962186f07fc9ed92087221..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee-Ex.timings
+++ /dev/null
@@ -1,28 +0,0 @@
-name	user	system	elapsed
-chmchablais3	0.688	0.016	0.703	
-circle2Raster	0.060	0.004	0.066	
-coregistration	3.656	0.004	3.659	
-createDisk	0	0	0	
-demFiltering	0.036	0.000	0.036	
-heightRegression	0.008	0.000	0.009	
-histDetection	0.044	0.000	0.043	
-laschablais3	0.248	0.000	0.250	
-maximaDetection	0.184	0.000	0.187	
-maximaSelection	0.136	0.000	0.137	
-plot2Dmatched	0.084	0.000	0.085	
-plotTreeInventory	0	0	0	
-points2DSM	0.308	0.000	0.309	
-points2DTM	0.348	0.000	0.346	
-polar2Projected	0.004	0.000	0.003	
-rasterChullMask	0.068	0.000	0.071	
-rasterLocalmax	3.668	0.000	3.666	
-rasterXYMask	0.016	0.000	0.015	
-rasters2Cor	0.064	0.000	0.066	
-rastersMovingCor	3.668	0.000	3.670	
-segAdjust	0.104	0.000	0.104	
-segmentation	0.112	0.000	0.111	
-speciesColor	0.004	0.000	0.003	
-treeExtraction	0.156	0.000	0.156	
-treeMatching	0.004	0.000	0.003	
-treeSegmentation	0.236	0.000	0.237	
-treeinventorychablais3	0.004	0.000	0.004	
diff --git a/lidaRtRee.Rcheck/lidaRtRee-manual.log b/lidaRtRee.Rcheck/lidaRtRee-manual.log
deleted file mode 100644
index 87f0b0591f21be7510507bf8dbaf30c38d768b29..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee-manual.log
+++ /dev/null
@@ -1,916 +0,0 @@
-This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2017.8.29)  27 APR 2018 13:57
-entering extended mode
- restricted \write18 enabled.
- %&-line parsing enabled.
-**\input ./Rd2.tex
-(./Rd2.tex
-(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
-Document Class: book 2007/10/19 v1.4h Standard LaTeX document class
-(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo
-File: bk10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
-)
-\c@part=\count79
-\c@chapter=\count80
-\c@section=\count81
-\c@subsection=\count82
-\c@subsubsection=\count83
-\c@paragraph=\count84
-\c@subparagraph=\count85
-\c@figure=\count86
-\c@table=\count87
-\abovecaptionskip=\skip41
-\belowcaptionskip=\skip42
-\bibindent=\dimen102
-)
-(/usr/share/R/share/texmf/tex/latex/Rd.sty
-Package: Rd 
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty
-Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
-)
-(/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty
-Package: longtable 2004/02/01 v4.11 Multi-page Table package (DPC)
-\LTleft=\skip43
-\LTright=\skip44
-\LTpre=\skip45
-\LTpost=\skip46
-\LTchunksize=\count88
-\LTcapwidth=\dimen103
-\LT@head=\box26
-\LT@firsthead=\box27
-\LT@foot=\box28
-\LT@lastfoot=\box29
-\LT@cols=\count89
-\LT@rows=\count90
-\c@LT@tables=\count91
-\c@LT@chunks=\count92
-\LT@p@ftn=\toks14
-)
-(/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty
-Package: bm 2004/02/26 v1.1c Bold Symbol Support (DPC/FMi)
-\symboldoperators=\mathgroup4
-\symboldletters=\mathgroup5
-\symboldsymbols=\mathgroup6
-LaTeX Font Info:    Redeclaring math alphabet \mathbf on input line 138.
-LaTeX Info: Redefining \bm on input line 204.
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty
-Package: alltt 1997/06/16 v2.0g defines alltt environment
-)
-(/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty
-Package: verbatim 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
-\every@verbatim=\toks15
-\verbatim@line=\toks16
-\verbatim@in@stream=\read1
-)
-(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty
-\Urlmuskip=\muskip10
-Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
-Package: textcomp 2005/09/27 v1.99g Standard LaTeX package
-Package textcomp Info: Sub-encoding information:
-(textcomp)               5 = only ISO-Adobe without \textcurrency
-(textcomp)               4 = 5 + \texteuro
-(textcomp)               3 = 4 + \textohm
-(textcomp)               2 = 3 + \textestimated + \textcurrency
-(textcomp)               1 = TS1 - \textcircled - \t
-(textcomp)               0 = TS1 (full)
-(textcomp)             Font families with sub-encoding setting implement
-(textcomp)             only a restricted character set as indicated.
-(textcomp)             Family '?' is the default used for unknown fonts.
-(textcomp)             See the documentation for details.
-Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 71.
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def
-File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
-)
-LaTeX Info: Redefining \oldstylenums on input line 266.
-Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 281.
-Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 282.
-Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 283.
-Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 284.
-Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 285.
-Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 286.
-Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 287.
-Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 288.
-Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 289.
-Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 290.
-Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 291.
-Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 292.
-Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 293.
-Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 294.
-Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 295.
-Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 296.
-Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 297.
-Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 298.
-Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 299.
-Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 300.
-Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 301.
-Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 302.
-Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 303.
-Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 304.
-
-Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 305.
-Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 306.
-Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 307.
-Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 308.
-Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 309.
-Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 310.
-Package textcomp Info: Setting lmr sub-encoding to TS1/0 on input line 311.
-Package textcomp Info: Setting lmdh sub-encoding to TS1/0 on input line 312.
-Package textcomp Info: Setting lmss sub-encoding to TS1/0 on input line 313.
-Package textcomp Info: Setting lmssq sub-encoding to TS1/0 on input line 314.
-Package textcomp Info: Setting lmvtt sub-encoding to TS1/0 on input line 315.
-Package textcomp Info: Setting qhv sub-encoding to TS1/0 on input line 316.
-Package textcomp Info: Setting qag sub-encoding to TS1/0 on input line 317.
-Package textcomp Info: Setting qbk sub-encoding to TS1/0 on input line 318.
-Package textcomp Info: Setting qcr sub-encoding to TS1/0 on input line 319.
-Package textcomp Info: Setting qcs sub-encoding to TS1/0 on input line 320.
-Package textcomp Info: Setting qpl sub-encoding to TS1/0 on input line 321.
-Package textcomp Info: Setting qtm sub-encoding to TS1/0 on input line 322.
-Package textcomp Info: Setting qzc sub-encoding to TS1/0 on input line 323.
-Package textcomp Info: Setting qhvc sub-encoding to TS1/0 on input line 324.
-Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 325.
-Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 326.
-Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 327.
-Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 328.
-Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 329.
-Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 330.
-Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 331.
-Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 332.
-Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 333.
-Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 334.
-Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 335.
-Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 336.
-Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 337.
-Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 338.
-Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 339.
-Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 340.
-)
-\ldescriptionwidth=\skip47
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
-Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def
-File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
-LaTeX Font Info:    Redeclaring font encoding T1 on input line 43.
-))
-(/usr/share/texlive/texmf-dist/tex/latex/psnfss/times.sty
-Package: times 2005/04/12 PSNFSS-v9.2a (SPQR) 
-)
-(/usr/share/texlive/texmf-dist/tex/latex/inconsolata/zi4.sty
-Package: zi4 2013/06/09 zi4a
-
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
-Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
-\KV@toks@=\toks17
-)
-\zifour@ocount=\count93
-)
-(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
-Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)
-
-(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg
-File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
-)
-Package color Info: Driver file: pdftex.def on input line 130.
-
-(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
-File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
-
-(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty
-Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
-)
-(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
-Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
-)
-\Gread@gobject=\count94
-))
-(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
-Package: hyperref 2012/11/06 v6.83m Hypertext links for LaTeX
-
-(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
-Package: hobsub-hyperref 2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
-
-
-(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
-Package: hobsub-generic 2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
-Package: hobsub 2012/05/28 v1.13 Construct package bundles (HO)
-Package hobsub Info: Skipping package `infwarerr' (already loaded).
-Package hobsub Info: Skipping package `ltxcmds' (already loaded).
-Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
-Package ifluatex Info: LuaTeX not detected.
-Package: ifvtex 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
-Package ifvtex Info: VTeX not detected.
-Package: intcalc 2007/09/27 v1.1 Expandable calculations with integers (HO)
-Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
-Package ifpdf Info: pdfTeX in PDF mode is detected.
-Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
-Package etexcmds Info: Could not find \expanded.
-(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
-(etexcmds)             that some package has redefined \expanded.
-(etexcmds)             In the latter case, load this package earlier.
-Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
-Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
-Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
-)
-Package pdftexcmds Info: LuaTeX not detected.
-Package pdftexcmds Info: \pdf@primitive is available.
-Package pdftexcmds Info: \pdf@ifprimitive is available.
-Package pdftexcmds Info: \pdfdraftmode found.
-Package: pdfescape 2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
-Package: bigintcalc 2012/04/08 v1.3 Expandable calculations on big integers (HO
-)
-Package: bitset 2011/01/30 v1.1 Handle bit-vector datatype (HO)
-Package: uniquecounter 2011/01/30 v1.2 Provide unlimited unique counter (HO)
-)
-Package hobsub Info: Skipping package `hobsub' (already loaded).
-Package: letltxmacro 2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
-Package: hopatch 2012/05/28 v1.2 Wrapper for package hooks (HO)
-Package: xcolor-patch 2011/01/30 xcolor patch
-Package: atveryend 2011/06/30 v1.8 Hooks at the very end of document (HO)
-Package atveryend Info: \enddocument detected (standard20110627).
-Package: atbegshi 2011/10/05 v1.16 At begin shipout hook (HO)
-Package: refcount 2011/10/16 v3.4 Data extraction from label references (HO)
-Package: hycolor 2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
-)
-(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
-Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
-)
-(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty
-Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO)
-)
-(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
-Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
-)
-\@linkdim=\dimen104
-\Hy@linkcounter=\count95
-\Hy@pagecounter=\count96
-
-(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
-File: pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
-)
-\Hy@SavedSpaceFactor=\count97
-
-(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg
-File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
-)
-Package hyperref Info: Hyper figures OFF on input line 4443.
-Package hyperref Info: Link nesting OFF on input line 4448.
-Package hyperref Info: Hyper index ON on input line 4451.
-Package hyperref Info: Plain pages OFF on input line 4458.
-Package hyperref Info: Backreferencing OFF on input line 4463.
-Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
-Package hyperref Info: Bookmarks ON on input line 4688.
-\c@Hy@tempcnt=\count98
-LaTeX Info: Redefining \url on input line 5041.
-\XeTeXLinkMargin=\dimen105
-\Fld@menulength=\count99
-\Field@Width=\dimen106
-\Fld@charsize=\dimen107
-Package hyperref Info: Hyper figures OFF on input line 6295.
-Package hyperref Info: Link nesting OFF on input line 6300.
-Package hyperref Info: Hyper index ON on input line 6303.
-Package hyperref Info: backreferencing OFF on input line 6310.
-Package hyperref Info: Link coloring OFF on input line 6315.
-Package hyperref Info: Link coloring with OCG OFF on input line 6320.
-Package hyperref Info: PDF/A mode OFF on input line 6325.
-LaTeX Info: Redefining \ref on input line 6365.
-LaTeX Info: Redefining \pageref on input line 6369.
-\Hy@abspage=\count100
-\c@Item=\count101
-\c@Hfootnote=\count102
-)
-
-Package hyperref Message: Driver (autodetected): hpdftex.
-
-(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
-File: hpdftex.def 2012/11/06 v6.83m Hyperref driver for pdfTeX
-\Fld@listcount=\count103
-\c@bookmark@seq@number=\count104
-
-(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
-Package: rerunfilecheck 2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
-Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
-82.
-)
-\Hy@SectionHShift=\skip48
-)
-
-Package hyperref Warning: Option `hyperindex' has already been used,
-(hyperref)                setting the option has no effect on input line 366.
-
-Package hyperref Info: Option `colorlinks' set `true' on input line 366.
-
-Package hyperref Warning: Option `pagebackref' has already been used,
-(hyperref)                setting the option has no effect on input line 366.
-
-Package hyperref Info: Option `linktocpage' set `true' on input line 366.
-Package hyperref Info: Option `plainpages' set `false' on input line 366.
-) (/usr/share/texlive/texmf-dist/tex/latex/base/makeidx.sty
-Package: makeidx 2000/03/29 v1.0m Standard LaTeX package
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
-Package: inputenc 2008/03/30 v1.1d Input encoding file
-\inpenc@prehook=\toks18
-\inpenc@posthook=\toks19
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-Now handling font encoding OML ...
-... no UTF-8 mapping file for font encoding OML
-Now handling font encoding T1 ...
-... processing UTF-8 mapping file for font encoding T1
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu
-File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
-   defining Unicode char U+00A1 (decimal 161)
-   defining Unicode char U+00A3 (decimal 163)
-   defining Unicode char U+00AB (decimal 171)
-   defining Unicode char U+00BB (decimal 187)
-   defining Unicode char U+00BF (decimal 191)
-   defining Unicode char U+00C0 (decimal 192)
-   defining Unicode char U+00C1 (decimal 193)
-   defining Unicode char U+00C2 (decimal 194)
-   defining Unicode char U+00C3 (decimal 195)
-   defining Unicode char U+00C4 (decimal 196)
-   defining Unicode char U+00C5 (decimal 197)
-   defining Unicode char U+00C6 (decimal 198)
-   defining Unicode char U+00C7 (decimal 199)
-   defining Unicode char U+00C8 (decimal 200)
-   defining Unicode char U+00C9 (decimal 201)
-   defining Unicode char U+00CA (decimal 202)
-   defining Unicode char U+00CB (decimal 203)
-   defining Unicode char U+00CC (decimal 204)
-   defining Unicode char U+00CD (decimal 205)
-   defining Unicode char U+00CE (decimal 206)
-   defining Unicode char U+00CF (decimal 207)
-   defining Unicode char U+00D0 (decimal 208)
-   defining Unicode char U+00D1 (decimal 209)
-   defining Unicode char U+00D2 (decimal 210)
-   defining Unicode char U+00D3 (decimal 211)
-   defining Unicode char U+00D4 (decimal 212)
-   defining Unicode char U+00D5 (decimal 213)
-   defining Unicode char U+00D6 (decimal 214)
-   defining Unicode char U+00D8 (decimal 216)
-   defining Unicode char U+00D9 (decimal 217)
-   defining Unicode char U+00DA (decimal 218)
-   defining Unicode char U+00DB (decimal 219)
-   defining Unicode char U+00DC (decimal 220)
-   defining Unicode char U+00DD (decimal 221)
-   defining Unicode char U+00DE (decimal 222)
-   defining Unicode char U+00DF (decimal 223)
-   defining Unicode char U+00E0 (decimal 224)
-   defining Unicode char U+00E1 (decimal 225)
-   defining Unicode char U+00E2 (decimal 226)
-   defining Unicode char U+00E3 (decimal 227)
-   defining Unicode char U+00E4 (decimal 228)
-   defining Unicode char U+00E5 (decimal 229)
-   defining Unicode char U+00E6 (decimal 230)
-   defining Unicode char U+00E7 (decimal 231)
-   defining Unicode char U+00E8 (decimal 232)
-   defining Unicode char U+00E9 (decimal 233)
-   defining Unicode char U+00EA (decimal 234)
-   defining Unicode char U+00EB (decimal 235)
-   defining Unicode char U+00EC (decimal 236)
-   defining Unicode char U+00ED (decimal 237)
-   defining Unicode char U+00EE (decimal 238)
-   defining Unicode char U+00EF (decimal 239)
-   defining Unicode char U+00F0 (decimal 240)
-   defining Unicode char U+00F1 (decimal 241)
-   defining Unicode char U+00F2 (decimal 242)
-   defining Unicode char U+00F3 (decimal 243)
-   defining Unicode char U+00F4 (decimal 244)
-   defining Unicode char U+00F5 (decimal 245)
-   defining Unicode char U+00F6 (decimal 246)
-   defining Unicode char U+00F8 (decimal 248)
-   defining Unicode char U+00F9 (decimal 249)
-   defining Unicode char U+00FA (decimal 250)
-   defining Unicode char U+00FB (decimal 251)
-   defining Unicode char U+00FC (decimal 252)
-   defining Unicode char U+00FD (decimal 253)
-   defining Unicode char U+00FE (decimal 254)
-   defining Unicode char U+00FF (decimal 255)
-   defining Unicode char U+0102 (decimal 258)
-   defining Unicode char U+0103 (decimal 259)
-   defining Unicode char U+0104 (decimal 260)
-   defining Unicode char U+0105 (decimal 261)
-   defining Unicode char U+0106 (decimal 262)
-   defining Unicode char U+0107 (decimal 263)
-   defining Unicode char U+010C (decimal 268)
-   defining Unicode char U+010D (decimal 269)
-   defining Unicode char U+010E (decimal 270)
-   defining Unicode char U+010F (decimal 271)
-   defining Unicode char U+0110 (decimal 272)
-   defining Unicode char U+0111 (decimal 273)
-   defining Unicode char U+0118 (decimal 280)
-   defining Unicode char U+0119 (decimal 281)
-   defining Unicode char U+011A (decimal 282)
-   defining Unicode char U+011B (decimal 283)
-   defining Unicode char U+011E (decimal 286)
-   defining Unicode char U+011F (decimal 287)
-   defining Unicode char U+0130 (decimal 304)
-   defining Unicode char U+0131 (decimal 305)
-   defining Unicode char U+0132 (decimal 306)
-   defining Unicode char U+0133 (decimal 307)
-   defining Unicode char U+0139 (decimal 313)
-   defining Unicode char U+013A (decimal 314)
-   defining Unicode char U+013D (decimal 317)
-   defining Unicode char U+013E (decimal 318)
-   defining Unicode char U+0141 (decimal 321)
-   defining Unicode char U+0142 (decimal 322)
-   defining Unicode char U+0143 (decimal 323)
-   defining Unicode char U+0144 (decimal 324)
-   defining Unicode char U+0147 (decimal 327)
-   defining Unicode char U+0148 (decimal 328)
-   defining Unicode char U+014A (decimal 330)
-   defining Unicode char U+014B (decimal 331)
-   defining Unicode char U+0150 (decimal 336)
-   defining Unicode char U+0151 (decimal 337)
-   defining Unicode char U+0152 (decimal 338)
-   defining Unicode char U+0153 (decimal 339)
-   defining Unicode char U+0154 (decimal 340)
-   defining Unicode char U+0155 (decimal 341)
-   defining Unicode char U+0158 (decimal 344)
-   defining Unicode char U+0159 (decimal 345)
-   defining Unicode char U+015A (decimal 346)
-   defining Unicode char U+015B (decimal 347)
-   defining Unicode char U+015E (decimal 350)
-   defining Unicode char U+015F (decimal 351)
-   defining Unicode char U+0160 (decimal 352)
-   defining Unicode char U+0161 (decimal 353)
-   defining Unicode char U+0162 (decimal 354)
-   defining Unicode char U+0163 (decimal 355)
-   defining Unicode char U+0164 (decimal 356)
-   defining Unicode char U+0165 (decimal 357)
-   defining Unicode char U+016E (decimal 366)
-   defining Unicode char U+016F (decimal 367)
-   defining Unicode char U+0170 (decimal 368)
-   defining Unicode char U+0171 (decimal 369)
-   defining Unicode char U+0178 (decimal 376)
-   defining Unicode char U+0179 (decimal 377)
-   defining Unicode char U+017A (decimal 378)
-   defining Unicode char U+017B (decimal 379)
-   defining Unicode char U+017C (decimal 380)
-   defining Unicode char U+017D (decimal 381)
-   defining Unicode char U+017E (decimal 382)
-   defining Unicode char U+200C (decimal 8204)
-   defining Unicode char U+2013 (decimal 8211)
-   defining Unicode char U+2014 (decimal 8212)
-   defining Unicode char U+2018 (decimal 8216)
-   defining Unicode char U+2019 (decimal 8217)
-   defining Unicode char U+201A (decimal 8218)
-   defining Unicode char U+201C (decimal 8220)
-   defining Unicode char U+201D (decimal 8221)
-   defining Unicode char U+201E (decimal 8222)
-   defining Unicode char U+2030 (decimal 8240)
-   defining Unicode char U+2031 (decimal 8241)
-   defining Unicode char U+2039 (decimal 8249)
-   defining Unicode char U+203A (decimal 8250)
-   defining Unicode char U+2423 (decimal 9251)
-)
-Now handling font encoding OT1 ...
-... processing UTF-8 mapping file for font encoding OT1
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu
-File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
-   defining Unicode char U+00A1 (decimal 161)
-   defining Unicode char U+00A3 (decimal 163)
-   defining Unicode char U+00B8 (decimal 184)
-   defining Unicode char U+00BF (decimal 191)
-   defining Unicode char U+00C5 (decimal 197)
-   defining Unicode char U+00C6 (decimal 198)
-   defining Unicode char U+00D8 (decimal 216)
-   defining Unicode char U+00DF (decimal 223)
-   defining Unicode char U+00E6 (decimal 230)
-   defining Unicode char U+00EC (decimal 236)
-   defining Unicode char U+00ED (decimal 237)
-   defining Unicode char U+00EE (decimal 238)
-   defining Unicode char U+00EF (decimal 239)
-   defining Unicode char U+00F8 (decimal 248)
-   defining Unicode char U+0131 (decimal 305)
-   defining Unicode char U+0141 (decimal 321)
-   defining Unicode char U+0142 (decimal 322)
-   defining Unicode char U+0152 (decimal 338)
-   defining Unicode char U+0153 (decimal 339)
-   defining Unicode char U+2013 (decimal 8211)
-   defining Unicode char U+2014 (decimal 8212)
-   defining Unicode char U+2018 (decimal 8216)
-   defining Unicode char U+2019 (decimal 8217)
-   defining Unicode char U+201C (decimal 8220)
-   defining Unicode char U+201D (decimal 8221)
-)
-Now handling font encoding OMS ...
-... processing UTF-8 mapping file for font encoding OMS
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu
-File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
-   defining Unicode char U+00A7 (decimal 167)
-   defining Unicode char U+00B6 (decimal 182)
-   defining Unicode char U+00B7 (decimal 183)
-   defining Unicode char U+2020 (decimal 8224)
-   defining Unicode char U+2021 (decimal 8225)
-   defining Unicode char U+2022 (decimal 8226)
-)
-Now handling font encoding OMX ...
-... no UTF-8 mapping file for font encoding OMX
-Now handling font encoding U ...
-... no UTF-8 mapping file for font encoding U
-Now handling font encoding TS1 ...
-... processing UTF-8 mapping file for font encoding TS1
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.dfu
-File: ts1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc
-   defining Unicode char U+00A2 (decimal 162)
-   defining Unicode char U+00A3 (decimal 163)
-   defining Unicode char U+00A4 (decimal 164)
-   defining Unicode char U+00A5 (decimal 165)
-   defining Unicode char U+00A6 (decimal 166)
-   defining Unicode char U+00A7 (decimal 167)
-   defining Unicode char U+00A8 (decimal 168)
-   defining Unicode char U+00A9 (decimal 169)
-   defining Unicode char U+00AA (decimal 170)
-   defining Unicode char U+00AC (decimal 172)
-   defining Unicode char U+00AE (decimal 174)
-   defining Unicode char U+00AF (decimal 175)
-   defining Unicode char U+00B0 (decimal 176)
-   defining Unicode char U+00B1 (decimal 177)
-   defining Unicode char U+00B2 (decimal 178)
-   defining Unicode char U+00B3 (decimal 179)
-   defining Unicode char U+00B4 (decimal 180)
-   defining Unicode char U+00B5 (decimal 181)
-   defining Unicode char U+00B6 (decimal 182)
-   defining Unicode char U+00B7 (decimal 183)
-   defining Unicode char U+00B9 (decimal 185)
-   defining Unicode char U+00BA (decimal 186)
-   defining Unicode char U+00BC (decimal 188)
-   defining Unicode char U+00BD (decimal 189)
-   defining Unicode char U+00BE (decimal 190)
-   defining Unicode char U+00D7 (decimal 215)
-   defining Unicode char U+00F7 (decimal 247)
-   defining Unicode char U+0192 (decimal 402)
-   defining Unicode char U+02C7 (decimal 711)
-   defining Unicode char U+02D8 (decimal 728)
-   defining Unicode char U+02DD (decimal 733)
-   defining Unicode char U+0E3F (decimal 3647)
-   defining Unicode char U+2016 (decimal 8214)
-   defining Unicode char U+2020 (decimal 8224)
-   defining Unicode char U+2021 (decimal 8225)
-   defining Unicode char U+2022 (decimal 8226)
-   defining Unicode char U+2030 (decimal 8240)
-   defining Unicode char U+2031 (decimal 8241)
-   defining Unicode char U+203B (decimal 8251)
-   defining Unicode char U+203D (decimal 8253)
-   defining Unicode char U+2044 (decimal 8260)
-   defining Unicode char U+204E (decimal 8270)
-   defining Unicode char U+2052 (decimal 8274)
-   defining Unicode char U+20A1 (decimal 8353)
-   defining Unicode char U+20A4 (decimal 8356)
-   defining Unicode char U+20A6 (decimal 8358)
-   defining Unicode char U+20A9 (decimal 8361)
-   defining Unicode char U+20AB (decimal 8363)
-   defining Unicode char U+20AC (decimal 8364)
-   defining Unicode char U+20B1 (decimal 8369)
-   defining Unicode char U+2103 (decimal 8451)
-   defining Unicode char U+2116 (decimal 8470)
-   defining Unicode char U+2117 (decimal 8471)
-   defining Unicode char U+211E (decimal 8478)
-   defining Unicode char U+2120 (decimal 8480)
-   defining Unicode char U+2122 (decimal 8482)
-   defining Unicode char U+2126 (decimal 8486)
-   defining Unicode char U+2127 (decimal 8487)
-   defining Unicode char U+212E (decimal 8494)
-   defining Unicode char U+2190 (decimal 8592)
-   defining Unicode char U+2191 (decimal 8593)
-   defining Unicode char U+2192 (decimal 8594)
-   defining Unicode char U+2193 (decimal 8595)
-   defining Unicode char U+2329 (decimal 9001)
-   defining Unicode char U+232A (decimal 9002)
-   defining Unicode char U+2422 (decimal 9250)
-   defining Unicode char U+25E6 (decimal 9702)
-   defining Unicode char U+25EF (decimal 9711)
-   defining Unicode char U+266A (decimal 9834)
-)
-Now handling font encoding PD1 ...
-... no UTF-8 mapping file for font encoding PD1
-   defining Unicode char U+00A9 (decimal 169)
-   defining Unicode char U+00AA (decimal 170)
-   defining Unicode char U+00AE (decimal 174)
-   defining Unicode char U+00BA (decimal 186)
-   defining Unicode char U+02C6 (decimal 710)
-   defining Unicode char U+02DC (decimal 732)
-   defining Unicode char U+200C (decimal 8204)
-   defining Unicode char U+2026 (decimal 8230)
-   defining Unicode char U+2122 (decimal 8482)
-   defining Unicode char U+2423 (decimal 9251)
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/latin1.def
-File: latin1.def 2008/03/30 v1.1d Input encoding file
-))
-\@indexfile=\write3
-\openout3 = `Rd2.idx'.
-
-
-Writing index file Rd2.idx
-(./Rd2.aux)
-\openout1 = `Rd2.aux'.
-
-LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 8.
-LaTeX Font Info:    Try loading font information for TS1+cmr on input line 8.
- (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd
-File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
-)
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 8.
-LaTeX Font Info:    ... okay on input line 8.
-LaTeX Font Info:    Try loading font information for T1+ptm on input line 8.
-
-(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1ptm.fd
-File: t1ptm.fd 2001/06/04 font definitions for T1/ptm.
-)
-(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
-[Loading MPS to PDF converter (version 2006.09.02).]
-\scratchcounter=\count105
-\scratchdimen=\dimen108
-\scratchbox=\box30
-\nofMPsegments=\count106
-\nofMParguments=\count107
-\everyMPshowfont=\toks20
-\MPscratchCnt=\count108
-\MPscratchDim=\dimen109
-\MPnumerator=\count109
-\makeMPintoPDFobject=\count110
-\everyMPtoPDFconversion=\toks21
-)
-\AtBeginShipoutBox=\box31
-Package hyperref Info: Link coloring ON on input line 8.
- (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
-Package: nameref 2012/10/27 v2.43 Cross-referencing by name of section
-
-(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
-Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO)
-)
-\c@section@level=\count111
-)
-LaTeX Info: Redefining \ref on input line 8.
-LaTeX Info: Redefining \pageref on input line 8.
-LaTeX Info: Redefining \nameref on input line 8.
-
-(./Rd2.out) (./Rd2.out)
-\@outlinefile=\write4
-\openout4 = `Rd2.out'.
-
-LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <24.88> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 9.
-LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <10> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 11.
-LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <20.74> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 11.
-LaTeX Font Info:    Try loading font information for T1+zi4 on input line 20.
-
-(/usr/share/texlive/texmf-dist/tex/latex/inconsolata/t1zi4.fd
-File: t1zi4.fd 2013/06/09 T1/zi4 (Inconsolata)
-)
-LaTeX Font Info:    External font `cmex10' loaded for size
-(Font)              <7> on input line 22.
-LaTeX Font Info:    External font `cmex10' loaded for size
-(Font)              <5> on input line 22.
-LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <14.4> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 31.
-LaTeX Font Info:    Try loading font information for T1+phv on input line 31.
-
-(/usr/share/texlive/texmf-dist/tex/latex/psnfss/t1phv.fd
-File: t1phv.fd 2001/06/04 scalable font definitions for T1/phv.
-) (./Rd2.toc [1
-
-
-{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}])
-\tf@toc=\write5
-\openout5 = `Rd2.toc'.
-
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [2]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [3]
-Overfull \hbox (6.9469pt too wide) in paragraph at lines 136--137
-[]\T1/ptm/m/n/10 Monnet, J.-M. and Mer-min, E. 2014. Cross-Correlation of Di-am
--e-ter Mea-sures for the Co-Registration
- []
-
-[4]
-Overfull \hbox (20.58093pt too wide) in paragraph at lines 170--170
- []\T1/zi4/m/n/9 coregistration <- coregistration(chm, trees, mask=tree.mask, b
-uffer=8, pas=1, dm=1, plot=TRUE)[] 
- []
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [5] [6]
-Overfull \hbox (35.88092pt too wide) in paragraph at lines 266--266
- []\T1/zi4/m/n/9 im2 <- demFiltering(chmchablais3, nlFilter="Median", nlSize=3,
- sigmap=cbind(c(0.2,0.8), c(0,15)))[] 
- []
-
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [7]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [8]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [9]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [10]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [11]
-Overfull \hbox (1.7981pt too wide) in paragraph at lines 533--534
-[]\T1/ptm/m/n/10 cimg ob-ject. im-age with lo-cal max-ima (typ-i-cally out-put 
-from [][]\T1/zi4/m/n/10 maximaDetection[][][]\T1/ptm/m/n/10 ,
- []
-
-[12] (/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [13]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [14]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [15]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [16] [17]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [18] [19]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [20]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [21]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [22]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [23]
-Overfull \hbox (55.1081pt too wide) in paragraph at lines 1193--1194
-[]\T1/ptm/m/n/10 numeric. thresh-old for re-movel of pix-els which ini-tial val
--ues are lower (\T1/zi4/m/n/10 dem.nl < min.value\T1/ptm/m/n/10 ) 
- []
-
-[24] (/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-Overfull \hbox (29.96898pt too wide) in paragraph at lines 1259--1260
-[]\T1/ptm/m/n/10 cimg ob-ject. im-age with seed points (e.g. from [][]\T1/zi4/m
-/n/10 maximaDetection[][][] \T1/ptm/m/n/10 or [][]\T1/zi4/m/n/10 maximaSelectio
-n[][][]
- []
-
-[25] (/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [26]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-)
-Overfull \hbox (25.75699pt too wide) in paragraph at lines 1343--1344
-\T1/ptm/m/n/10 puted from three im-ages: ini-tial, lo-cal max-ima and seg-mente
-d, typ-i-cally ob-tained with [][]\T1/zi4/m/n/10 treeSegmentation[][][] 
- []
-
-
-Overfull \hbox (1.68091pt too wide) in paragraph at lines 1380--1380
- []\T1/zi4/m/n/9 trees <- treeExtraction(segments$filled.dem, segments$local.ma
-xima, segments$segments.id)[] 
- []
-
-[27]
-LaTeX Font Info:    Try loading font information for TS1+zi4 on input line 1387
-.
- (/usr/share/texlive/texmf-dist/tex/latex/inconsolata/ts1zi4.fd
-File: ts1zi4.fd 2013/06/07 Fontinst v1.933 font definitions for TS1/zi4.
-)
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [28]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [29]
-(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
-File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc
-) [30]
-Overfull \hbox (19.88098pt too wide) in paragraph at lines 1545--1546
-[][][]\T1/zi4/m/n/10 demFiltering[][][]\T1/ptm/m/n/10 , [][]\T1/zi4/m/n/10 maxi
-maDetection[][][]\T1/ptm/m/n/10 , [][]\T1/zi4/m/n/10 maximaDetection[][][]\T1/p
-tm/m/n/10 , [][]\T1/zi4/m/n/10 maximaSelection[][][]\T1/ptm/m/n/10 , [][]\T1/zi
-4/m/n/10 segmentation[][][]\T1/ptm/m/n/10 , [][]\T1/zi4/m/n/10 segAdjust[][][]\
-T1/ptm/m/n/10 ,
- []
-
-
-Overfull \hbox (2.5809pt too wide) in paragraph at lines 1555--1555
- []  \T1/zi4/m/n/9 sigma=cbind(c(0.2,0.8), c(0,15)),dmin=0,dprop=0,hmin=10,prop
-Houppier=0.5,minHouppier=5)[] 
- []
-
-(./Rd2.ind [31] [32]
-LaTeX Font Info:    Font shape `T1/ptm/bx/n' in size <12> not available
-(Font)              Font shape `T1/ptm/b/n' tried instead on input line 3.
- [33
-
-])
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1575.
-Package atveryend Info: Empty hook `AfterLastShipout' on input line 1575.
- (./Rd2.aux)
-Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1575.
-Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1575.
-
-Package rerunfilecheck Info: File `Rd2.out' has not changed.
-(rerunfilecheck)             Checksum: 6C499C3DA08A2A56F40A36A3622EDD8A;1696.
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1575.
- ) 
-Here is how much of TeX's memory you used:
- 6672 strings out of 494958
- 96547 string characters out of 6179213
- 167148 words of memory out of 5000000
- 9469 multiletter control sequences out of 15000+600000
- 40963 words of font info for 50 fonts, out of 8000000 for 9000
- 36 hyphenation exceptions out of 8191
- 38i,6n,34p,567b,592s stack positions out of 5000i,500n,10000p,200000b,80000s
-pdfTeX warning (dest): name{Rfn.grid.Rul.terrain} has been referenced but doe
-s not exist, replaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.interp} has been referenced but does not exist,
- replaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.cimg} has been referenced but does not exist, r
-eplaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.LAS} has been referenced but does not exist, re
-placed by a fixed one
-
-pdfTeX warning (dest): name{Rfn.as.cimg} has been referenced but does not exist
-, replaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.deriche} has been referenced but does not exist
-, replaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.medianblur} has been referenced but does not ex
-ist, replaced by a fixed one
-
-pdfTeX warning (dest): name{Rfn.mclosing} has been referenced but does not exis
-t, replaced by a fixed one
-
-{/usr/share/texlive/texmf-dist/fonts/enc/dvips/inconsolata/i4-ts1.enc}{/usr/sha
-re/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}{/usr/share/texlive/texmf-dis
-t/fonts/enc/dvips/inconsolata/i4-t1-0.enc}</usr/share/texlive/texmf-dist/fonts/
-type1/public/inconsolata/Inconsolata-zi4r.pfb></usr/share/texlive/texmf-dist/fo
-nts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/ty
-pe1/urw/helvetic/uhvr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/time
-s/utmb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb></
-usr/share/texlive/texmf-dist/fonts/type1/urw/times/utmr8a.pfb></usr/share/texli
-ve/texmf-dist/fonts/type1/urw/times/utmri8a.pfb>
-Output written on Rd2.pdf (33 pages, 144393 bytes).
-PDF statistics:
- 765 PDF objects out of 1000 (max. 8388607)
- 715 compressed objects within 8 object streams
- 277 named destinations out of 1000 (max. 500000)
- 233 words of extra memory for PDF output out of 10000 (max. 10000000)
-
diff --git a/lidaRtRee.Rcheck/lidaRtRee-manual.pdf b/lidaRtRee.Rcheck/lidaRtRee-manual.pdf
deleted file mode 100644
index 1963ed9ac1ece346444c590fb9bf567a7512574c..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee-manual.pdf and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/DESCRIPTION b/lidaRtRee.Rcheck/lidaRtRee/DESCRIPTION
deleted file mode 100644
index d313dd887f71d63db9da32c94ee4bb4ddb4bc595..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/DESCRIPTION
+++ /dev/null
@@ -1,19 +0,0 @@
-Package: lidaRtRee
-Type: Package
-Version: 1.0.1
-Title: Forest Analysis with Airborne Laser Scanning (Lidar) Data
-Date: 2018-06-05
-Author: Jean-Matthieu Monnet [aut, cre]
-Maintainer: Jean-Matthieu Monnet <jean-matthieu.monnet@irstea.fr>
-Description: Provides functions for forest analysis using airborne laser scanning data. It includes complementary steps for foret mapping: extraction of both physical and statistical features from lidar data, model calibration with ground reference, and maps export. 
-URL: https://gitlab.irstea.fr/jean-matthieu.monnet/lidaRtRee
-BugReports: https://gitlab.irstea.fr/jean-matthieu.monnet/lidaRtRee/issues
-Imports: graphics, stats, grDevices, sp, raster, imager, akima, leaps,
-        gvlma, car, foreach, doParallel, reldist, lidR (>= 1.4-2)
-License: GPL-3
-LazyData: TRUE
-RoxygenNote: 6.0.1
-NeedsCompilation: no
-Packaged: 2018-06-21 08:49:12 UTC; jean-matthieu
-Depends: R (>= 2.10)
-Built: R 3.4.4; ; 2018-06-21 08:49:42 UTC; unix
diff --git a/lidaRtRee.Rcheck/lidaRtRee/INDEX b/lidaRtRee.Rcheck/lidaRtRee/INDEX
deleted file mode 100644
index 244aa1edabea01525c2da77464a060992923e24d..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/INDEX
+++ /dev/null
@@ -1,41 +0,0 @@
-chmchablais3            Canopy height model (Chablais 3 plot)
-circle2Raster           Raster corresponding to circle extent
-coregistration          Tree inventory and canopy height model
-                        coregistration
-createDisk              Disk-shaped matrix mask
-demFiltering            Image pre-processing (non-linear filtering and
-                        Gaussian smoothing)
-heightRegression        Regression of detected heights VS reference
-                        heights
-histDetection           Histogram of detection
-histStack               Stacked histogramm
-laschablais3            las data in France (Chablais 3 plot)
-maximaDetection         Local maxima extraction on image
-maximaSelection         Image maxima selection based on values and
-                        neighborhood of local maxima
-plot2Dmatched           Plot of matched pairs of detected and reference
-                        trees
-plotTreeInventory       Displays a map of tree inventory data
-points2DSM              Digital Surface Model
-points2DTM              Digital Terrain Model
-polar2Projected         Polar to cartesian coordinates conversion
-rasterChullMask         Raster mask of convex hull
-rasterLocalmax          Statistics of raster local maximum
-rasterXYMask            Raster mask by union of buffers around xy
-                        positions
-rasters2Cor             Correlation between two rasters
-rastersMovingCor        Correlation between rasters for different XY
-                        translations
-segAdjust               Modification of segments based on values
-segmentation            Image segmentation by seed-based watershed
-                        algorithm
-speciesColor            Table of species names, abreviations and
-                        display colors
-treeExtraction          Tree extraction
-treeMatching            3D matching of detected tree top positions with
-                        reference positions
-treeSegmentation        Preprocessing and segmentation of raster image
-                        for tree identification
-treeinventorychablais3
-                        Tree inventory data in France (Chablais 3 plot,
-                        July 2010)
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/Rd.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/Rd.rds
deleted file mode 100644
index 3a39707f9ff240fca54e1136021a63436a964060..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/Rd.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/data.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/data.rds
deleted file mode 100644
index e36decacdbe628708d08f100995e1ae1b0e7e4d5..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/data.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/features.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/features.rds
deleted file mode 100644
index 4400f982fd42a7ba25fafd6595825ff962e9c3c7..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/features.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/hsearch.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/hsearch.rds
deleted file mode 100644
index 06f65fc52622458ebe41f781d146cd5cc51e9d43..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/hsearch.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/links.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/links.rds
deleted file mode 100644
index e94788265f04fe695bf223046f6ff3d6a103a426..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/links.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/nsInfo.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/nsInfo.rds
deleted file mode 100644
index 997d0274da62e0b0603be814e96daca5f210a14b..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/nsInfo.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/Meta/package.rds b/lidaRtRee.Rcheck/lidaRtRee/Meta/package.rds
deleted file mode 100644
index cfd1818e9f208ac3d264c7b15062d3c3df94a612..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/Meta/package.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/NAMESPACE b/lidaRtRee.Rcheck/lidaRtRee/NAMESPACE
deleted file mode 100644
index 58820f9e280814f2752c5a1406665e5b155aed34..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/NAMESPACE
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated by roxygen2: do not edit by hand
-
-export(circle2Raster)
-export(coregistration)
-export(createDisk)
-export(demFiltering)
-export(heightRegression)
-export(histDetection)
-export(histStack)
-export(maximaDetection)
-export(maximaSelection)
-export(plot2Dmatched)
-export(plotTreeInventory)
-export(points2DSM)
-export(points2DTM)
-export(polar2Projected)
-export(rasterChullMask)
-export(rasterLocalmax)
-export(rasterXYMask)
-export(rasters2Cor)
-export(rastersMovingCor)
-export(segAdjust)
-export(segmentation)
-export(speciesColor)
-export(treeExtraction)
-export(treeMatching)
-export(treeSegmentation)
diff --git a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee b/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee
deleted file mode 100644
index 3b65e3cbb872050f5dbcfacd3f2057d52d28ba0e..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee
+++ /dev/null
@@ -1,27 +0,0 @@
-#  File share/R/nspackloader.R
-#  Part of the R package, http://www.R-project.org
-#
-#  Copyright (C) 1995-2012 The R Core Team
-#
-#  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.
-#
-#  A copy of the GNU General Public License is available at
-#  http://www.r-project.org/Licenses/
-
-local({
-    info <- loadingNamespaceInfo()
-    pkg <- info$pkgname
-    ns <- .getNamespace(as.name(pkg))
-    if (is.null(ns))
-        stop("cannot find namespace environment for ", pkg, domain = NA);
-    dbbase <- file.path(info$libname, pkg, "R", pkg)
-    lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.")
-})
diff --git a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdb b/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdb
deleted file mode 100644
index afac15aea3651cf1225211c32705dec93700be14..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdb and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdx b/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdx
deleted file mode 100644
index 614fbb995e15f137e1f4b4e16b8562c4b15eb863..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/R/lidaRtRee.rdx and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdb b/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdb
deleted file mode 100644
index 570fdf68b471788d11ddb0bacabe4e31c2f66d33..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdb and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rds b/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rds
deleted file mode 100644
index d8bdfba51c6a86749e5e0dbf3390ab1121afbff2..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdx b/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdx
deleted file mode 100644
index 49fac5be6a4de6503fb97bb52255fe7caa605dcb..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/data/Rdata.rdx and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/help/AnIndex b/lidaRtRee.Rcheck/lidaRtRee/help/AnIndex
deleted file mode 100644
index 332d61a3ae90ab4c1cd18281073f2cb9b9ca683b..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/help/AnIndex
+++ /dev/null
@@ -1,28 +0,0 @@
-chmchablais3	chmchablais3
-circle2Raster	circle2Raster
-coregistration	coregistration
-createDisk	createDisk
-demFiltering	demFiltering
-heightRegression	heightRegression
-histDetection	histDetection
-histStack	histStack
-laschablais3	laschablais3
-maximaDetection	maximaDetection
-maximaSelection	maximaSelection
-plot2Dmatched	plot2Dmatched
-plotTreeInventory	plotTreeInventory
-points2DSM	points2DSM
-points2DTM	points2DTM
-polar2Projected	polar2Projected
-rasterChullMask	rasterChullMask
-rasterLocalmax	rasterLocalmax
-rasters2Cor	rasters2Cor
-rastersMovingCor	rastersMovingCor
-rasterXYMask	rasterXYMask
-segAdjust	segAdjust
-segmentation	segmentation
-speciesColor	speciesColor
-treeExtraction	treeExtraction
-treeinventorychablais3	treeinventorychablais3
-treeMatching	treeMatching
-treeSegmentation	treeSegmentation
diff --git a/lidaRtRee.Rcheck/lidaRtRee/help/aliases.rds b/lidaRtRee.Rcheck/lidaRtRee/help/aliases.rds
deleted file mode 100644
index b1684d3629bc528b7f38f61a45dc2c8227402358..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/help/aliases.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdb b/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdb
deleted file mode 100644
index 3d3f775da6f449bebdab077039de6bbbc3f9a1ec..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdb and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdx b/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdx
deleted file mode 100644
index cc713a8f39d0bb602d7900b4f7e8c045779d3251..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/help/lidaRtRee.rdx and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/help/paths.rds b/lidaRtRee.Rcheck/lidaRtRee/help/paths.rds
deleted file mode 100644
index 37fc7cc0156570cbfcac147b47ffc8a796ca5ad6..0000000000000000000000000000000000000000
Binary files a/lidaRtRee.Rcheck/lidaRtRee/help/paths.rds and /dev/null differ
diff --git a/lidaRtRee.Rcheck/lidaRtRee/html/00Index.html b/lidaRtRee.Rcheck/lidaRtRee/html/00Index.html
deleted file mode 100644
index e42c2d3f276c33b8c2fbdf33424f76a80141dbfa..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/html/00Index.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head><title>R: Forest Analysis with Airborne Laser Scanning (Lidar) Data</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" type="text/css" href="R.css" />
-</head><body>
-<h1> Forest Analysis with Airborne Laser Scanning (Lidar) Data
-<img class="toplogo" src="../../../doc/html/Rlogo.svg" alt="[R logo]" />
-</h1>
-<hr/>
-<div style="text-align: center;">
-<a href="../../../doc/html/packages.html"><img class="arrow" src="../../../doc/html/left.jpg" alt="[Up]" /></a>
-<a href="../../../doc/html/index.html"><img class="arrow" src="../../../doc/html/up.jpg" alt="[Top]" /></a>
-</div><h2>Documentation for package &lsquo;lidaRtRee&rsquo; version 1.0</h2>
-
-<ul><li><a href="../DESCRIPTION">DESCRIPTION file</a>.</li>
-</ul>
-
-<h2>Help Pages</h2>
-
-
-<table width="100%">
-<tr><td style="width: 25%;"><a href="chmchablais3.html">chmchablais3</a></td>
-<td>Canopy height model (Chablais 3 plot)</td></tr>
-<tr><td style="width: 25%;"><a href="circle2Raster.html">circle2Raster</a></td>
-<td>Raster corresponding to circle extent</td></tr>
-<tr><td style="width: 25%;"><a href="coregistration.html">coregistration</a></td>
-<td>Tree inventory and canopy height model coregistration</td></tr>
-<tr><td style="width: 25%;"><a href="createDisk.html">createDisk</a></td>
-<td>Disk-shaped matrix mask</td></tr>
-<tr><td style="width: 25%;"><a href="demFiltering.html">demFiltering</a></td>
-<td>Image pre-processing (non-linear filtering and Gaussian smoothing)</td></tr>
-<tr><td style="width: 25%;"><a href="heightRegression.html">heightRegression</a></td>
-<td>Regression of detected heights VS reference heights</td></tr>
-<tr><td style="width: 25%;"><a href="histDetection.html">histDetection</a></td>
-<td>Histogram of detection</td></tr>
-<tr><td style="width: 25%;"><a href="histStack.html">histStack</a></td>
-<td>Stacked histogramm</td></tr>
-<tr><td style="width: 25%;"><a href="laschablais3.html">laschablais3</a></td>
-<td>las data in France (Chablais 3 plot)</td></tr>
-<tr><td style="width: 25%;"><a href="maximaDetection.html">maximaDetection</a></td>
-<td>Local maxima extraction on image</td></tr>
-<tr><td style="width: 25%;"><a href="maximaSelection.html">maximaSelection</a></td>
-<td>Image maxima selection based on values and neighborhood of local maxima</td></tr>
-<tr><td style="width: 25%;"><a href="plot2Dmatched.html">plot2Dmatched</a></td>
-<td>Plot of matched pairs of detected and reference trees</td></tr>
-<tr><td style="width: 25%;"><a href="plotTreeInventory.html">plotTreeInventory</a></td>
-<td>Displays a map of tree inventory data</td></tr>
-<tr><td style="width: 25%;"><a href="points2DSM.html">points2DSM</a></td>
-<td>Digital Surface Model</td></tr>
-<tr><td style="width: 25%;"><a href="points2DTM.html">points2DTM</a></td>
-<td>Digital Terrain Model</td></tr>
-<tr><td style="width: 25%;"><a href="polar2Projected.html">polar2Projected</a></td>
-<td>Polar to cartesian coordinates conversion</td></tr>
-<tr><td style="width: 25%;"><a href="rasterChullMask.html">rasterChullMask</a></td>
-<td>Raster mask of convex hull</td></tr>
-<tr><td style="width: 25%;"><a href="rasterLocalmax.html">rasterLocalmax</a></td>
-<td>Statistics of raster local maximum</td></tr>
-<tr><td style="width: 25%;"><a href="rasters2Cor.html">rasters2Cor</a></td>
-<td>Correlation between two rasters</td></tr>
-<tr><td style="width: 25%;"><a href="rastersMovingCor.html">rastersMovingCor</a></td>
-<td>Correlation between rasters for different XY translations</td></tr>
-<tr><td style="width: 25%;"><a href="rasterXYMask.html">rasterXYMask</a></td>
-<td>Raster mask by union of buffers around xy positions</td></tr>
-<tr><td style="width: 25%;"><a href="segAdjust.html">segAdjust</a></td>
-<td>Modification of segments based on values</td></tr>
-<tr><td style="width: 25%;"><a href="segmentation.html">segmentation</a></td>
-<td>Image segmentation by seed-based watershed algorithm</td></tr>
-<tr><td style="width: 25%;"><a href="speciesColor.html">speciesColor</a></td>
-<td>Table of species names, abreviations and display colors</td></tr>
-<tr><td style="width: 25%;"><a href="treeExtraction.html">treeExtraction</a></td>
-<td>Tree extraction</td></tr>
-<tr><td style="width: 25%;"><a href="treeinventorychablais3.html">treeinventorychablais3</a></td>
-<td>Tree inventory data in France (Chablais 3 plot, July 2010)</td></tr>
-<tr><td style="width: 25%;"><a href="treeMatching.html">treeMatching</a></td>
-<td>3D matching of detected tree top positions with reference positions</td></tr>
-<tr><td style="width: 25%;"><a href="treeSegmentation.html">treeSegmentation</a></td>
-<td>Preprocessing and segmentation of raster image for tree identification</td></tr>
-</table>
-</body></html>
diff --git a/lidaRtRee.Rcheck/lidaRtRee/html/R.css b/lidaRtRee.Rcheck/lidaRtRee/html/R.css
deleted file mode 100644
index f10f5ea669d3de9e84a2ce5bf5752546b99cd02d..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rcheck/lidaRtRee/html/R.css
+++ /dev/null
@@ -1,97 +0,0 @@
-body {
-    background: white;
-    color: black;
-}
-
-a:link {
-    background: white;
-    color: blue;
-}
-
-a:visited {
-    background: white;
-    color: rgb(50%, 0%, 50%);
-}
-
-h1 {
-    background: white;
-    color: rgb(55%, 55%, 55%);
-    font-family: monospace;
-    font-size: x-large;
-    text-align: center;
-}
-
-h2 {
-    background: white;
-    color: rgb(40%, 40%, 40%);
-    font-family: monospace;
-    font-size: large;
-    text-align: center;
-}
-
-h3 {
-    background: white;
-    color: rgb(40%, 40%, 40%);
-    font-family: monospace;
-    font-size: large;
-}
-
-h4 {
-    background: white;
-    color: rgb(40%, 40%, 40%);
-    font-family: monospace;
-    font-style: italic;
-    font-size: large;
-}
-
-h5 {
-    background: white;
-    color: rgb(40%, 40%, 40%);
-    font-family: monospace;
-}
-
-h6 {
-    background: white;
-    color: rgb(40%, 40%, 40%);
-    font-family: monospace;
-    font-style: italic;
-}
-		
-img.toplogo {
-    width: 4em;
-    vertical-align: middle;
-}
-
-img.arrow {
-    width: 30px;
-    height: 30px;
-    border: 0;
-}
-
-span.acronym {
-    font-size: small;
-}
-
-span.env {
-    font-family: monospace;
-}
-
-span.file {
-    font-family: monospace;
-}
-
-span.option{
-    font-family: monospace;
-}
-
-span.pkg {
-    font-weight: bold;
-}
-
-span.samp{
-    font-family: monospace;
-}
-
-div.vignettes a:hover {
-    background: rgb(85%, 85%, 85%);
-}
diff --git a/lidaRtRee.Rproj b/lidaRtRee.Rproj
deleted file mode 100644
index 39056fe7b383b4d550e541d1dd92ae2442d79305..0000000000000000000000000000000000000000
--- a/lidaRtRee.Rproj
+++ /dev/null
@@ -1,20 +0,0 @@
-Version: 1.0
-
-RestoreWorkspace: No
-SaveWorkspace: No
-AlwaysSaveHistory: Default
-
-EnableCodeIndexing: Yes
-UseSpacesForTab: Yes
-NumSpacesForTab: 2
-Encoding: UTF-8
-
-RnwWeave: Sweave
-LaTeX: pdfLaTeX
-
-BuildType: Package
-PackageUseDevtools: Yes
-PackageInstallArgs: --no-multiarch --with-keep.source --resave-data
-PackageBuildArgs: --resave-data
-PackageCheckArgs: --as-cran
-PackageRoxygenize: rd,collate,namespace