Skip to content

Commit

Permalink
solving merging conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
hzambran committed Apr 28, 2020
2 parents 0877514 + b4fa20a commit 06e4bdb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
importFrom("raster", brick, stack, mask, extract, nlayers, raster, distance, rasterize, writeRaster, compareRaster)
#importFrom("velox", velox)
importFrom("sp", "coordinates<-", areaSpatialGrid)
importFrom("sf", st_is, st_crs)
importFrom("sf", st_is, st_crs, st_as_sf, st_combine)
importFrom("zoo", is.zoo, index, write.zoo)
importFrom("utils", write.table, installed.packages, ls.str)
importFrom("parallel", makeCluster, stopCluster, clusterApply)
Expand Down
14 changes: 12 additions & 2 deletions R/RFmerge.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
# Started: 07-Nov-2019 (the package) #
# Updates: 16-Nov-2019 ; 10-Dec-2019 ; 11-Dec-2019 ; 12-Dec-2019 ; 13-Dec-2019 #
# 14-Dec-2019 ; 17-Dec-2019 ; 20-Dec-2019 ; 23-Dec-2019 #
<<<<<<< HEAD
# 27-Apr-2020 #
=======
# 30-Jan-2020 #
>>>>>>> b4fa20a9e8e582efcefae5691906ca4d2d2cbb6b
################################################################################

# 'x' : zoo object with ground-based values that will be used as the dependent variable to train the RF model.
Expand Down Expand Up @@ -114,10 +118,16 @@ RFmerge.zoo <- function(x, metadata, cov, mask, training,
} else if ( ( !(id %in% colnames(metadata) ) ) | ( !(lat %in% colnames(metadata) ) ) | ( !(lon %in% colnames(metadata) ) ) )
stop("Invalid argument: 'metadata' must have 'id' (identifier), 'lon' (longitude) and 'lat' (latitude) fields !")

# Cheking the mask
# Checking the mask
mask.crs <- NULL
if (!missing(mask)) {
if ( !sf::st_is(mask, c("POLYGON", "MULIPOLYGON")) ) {
if ( class(mask) %in% c("SpatialPolygons", "SpatialPolygonsDataFrame") )
mask <- sf::st_as_sf(mask)

if ( length(mask) > 1 )
mask <- sf::st_combine(mask)

if ( !sf::st_is(mask, c("POLYGON", "MULTIPOLYGON")) ) {
stop("Invalid argument: 'mask' must be a 'sf' (multi)polygon object !!")
} else mask.crs <- sf::st_crs(mask)$proj4string
} # IF end
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ citEntry(
note="",
doi="10.1016/j.rse.2019.111606",
url="https://authors.elsevier.com/c/1aKrd7qzSnJWL",
textVersion="Baez-Villanueva, O. M.; Zambrano-Bigiarini, M.; Beck, H.; McNamara, I.; Ribbe, L.; Nauditt, A.; Birkel, C.; Verbist, K.; Giraldo-Osorio, J.D.; Thinh, N.X. (2019). RF-MEP: a novel Random Forest method for merging gridded precipitation products and ground-based measurements, Remote Sensing of Environment, (accepted).",
textVersion="Baez-Villanueva, O. M.; Zambrano-Bigiarini, M.; Beck, H.; McNamara, I.; Ribbe, L.; Nauditt, A.; Birkel, C.; Verbist, K.; Giraldo-Osorio, J.D.; Thinh, N.X. (2020). RF-MEP: a novel Random Forest method for merging gridded precipitation products and ground-based measurements, Remote Sensing of Environment, 239, 111610. doi10.1016/j.rse.2019.111606.",
key = "BaezVillanueva+al2020-RFmerge_article"
)

Expand Down
2 changes: 1 addition & 1 deletion man/RFmerge.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Numeric indicating the maximum number trees to grow in the Random Forest algorit
A function to specify the action to be taken if NAs are found. (NOTE: If given, this argument must be named.)
}
\item{write2disk}{
logical, indicates if the output merged raster layers and the training and avaluation datasets (two files each, one with time series and other with metadata) will be written to the disk. By default \code{write2disk=TRUE}
logical, indicates if the output merged raster layers and the training and avaluation datasets (two files each, one with time series and other with metadata) will be written to the disk. By default \code{write2disk=FALSE}
}
\item{drty.out}{
Character with the full path to the directory where the final merged product will be exported as well as the training and evaluation datasets. Only used when \code{write2disk=TRUE}
Expand Down

0 comments on commit 06e4bdb

Please sign in to comment.