Skip to content

Commit

Permalink
adding missing arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
ytarazona committed Feb 28, 2021
1 parent 791f13c commit 8a7ed6a
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 3 deletions.
8 changes: 8 additions & 0 deletions R/calkmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ calkmeans <- function(img, k = NULL, iter.max = 10, algo = c("Hartigan-Wong", "L

#' Plot for the "calkmeans" class
#'
#' @param x Object of class "calkmeans".
#' @param xlab X-axis title.
#' @param ylab Y-axis title.
#' @param type Type of line.
#' @param main Title of the graph.
#' @param cex Graph line point size.
#' @param ... Graphical parameters to be passed in \link[base]{plot}.
#'
#' @export
#'
plot.calkmeans <- function(x, xlab, ylab, type, main, cex, ...){
Expand Down
2 changes: 2 additions & 0 deletions R/calmla.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
#' Cross-Validation (K-fold) approach.
#' @param iter Number of iterations, i.e number of times the analysis is executed.
#' @param verbose This paramater is Logical. It Prints progress messages during execution.
#' @param ... Parameters to be passed in machine learning algorithm. Please see \link[e1071]{svm}, \link[randomForest]{randomForest},
#' \link[e1071]{naiveBayes}, \link[caret]{train}, \link[nnet]{nnet} and \link[caret]{knn3}.
#'
#' @examples
#' library(ForesToolboxRS)
Expand Down
2 changes: 2 additions & 0 deletions R/fusionRS.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ fusionRS <- function(x, y, stand.varb = TRUE, na = FALSE, verbose = FALSE) {

#' Print for the "fusionRS" class
#'
#' @param x Object of class "fusionRS".
#'
#' @export
#'
print.fusionRS <- function(x){
Expand Down
4 changes: 4 additions & 0 deletions R/mla.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#' @param training_split For splitting samples into two subsets, i.e. training data and for
#' testing data.
#' @param verbose This paramater is Logical. It Prints progress messages during execution.
#' @param ... Parameters to be passed in machine learning algorithm. Please see \link[e1071]{svm}, \link[randomForest]{randomForest},
#' \link[e1071]{naiveBayes}, \link[caret]{train}, \link[nnet]{nnet} and \link[caret]{knn3}.
#'
#' @examples
#' library(ForesToolboxRS)
Expand Down Expand Up @@ -211,6 +213,8 @@ mla <- function(img, endm, model, training_split = 80, verbose = FALSE, ...){

#' Print for the "mla" class
#'
#' @param x Object of class "mla".
#'
#' @export
#'
print.mla <- function(x){
Expand Down
9 changes: 9 additions & 0 deletions R/plot.pvts.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
#'
#' @importFrom grDevices adjustcolor
#'
#' @param x Object of class "pvts".
#' @param ylab Y-axis title.
#' @param type Type of line.
#' @param col Type of color line.
#' @param lwd Line thickness size.
#' @param main Title of the graph.
#' @param cex Graph line point size.
#' @param ... Graphical parameters to be passed in \link[base]{plot}.
#'
#' @export
#'

Expand Down
4 changes: 3 additions & 1 deletion R/print.pvts.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#' Printing for the "pvts" class
#'
#' @param x Object of class "pvts".
#'
#' @export
#'

print.pvts <- function(x, ...) {
print.pvts <- function(x) {
cat("\n NON-SEASONAL DETECTION APPROACH
PVts-Beta Approach\n")
if(!is.na(x$Breakpoint[1])) {
Expand Down
15 changes: 14 additions & 1 deletion R/rkmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,27 @@
#'
#' @export
#'
rkmeans <- function(img, k, iter.max = 100, nstart = 50, algo = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"), ...){
rkmeans <- function(img, k, iter.max = 100, nstart = 50, algo = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"), verbose = FALSE, ...){

vr <- getValues(img)

if(verbose){
message(paste0(paste0(rep("*",10), collapse = ""), " Getting NA positions ", paste0(rep("*",10), collapse = "")))
}

i <- which(!is.na(vr)) # NA positions

if(verbose){
message(paste0(paste0(rep("*",10), collapse = ""), " Appling kmeans ", paste0(rep("*",10), collapse = "")))
}

# Applying kmeans
km <- kmeans(na.omit(vr), k, iter.max, nstart, algorithm = algo, ...)

if(verbose){
message(paste0(paste0(rep("*",10), collapse = ""), " Obtained raster ", paste0(rep("*",10), collapse = "")))
}

raster_class <- raster(img)
raster_class[i] <- km$cluster

Expand Down
2 changes: 1 addition & 1 deletion R/smootH.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' @importFrom zoo na.approx na.spline
#'
#' @param x Numeric, matrix.
#' @param interp Four interpolation methods are presented, "na.interp",
#' @param method.interp Four interpolation methods are presented, "na.interp",
#' "na.approx" and "na.spline". By default is the method "na.interp".
#'
#' @examples
Expand Down

0 comments on commit 8a7ed6a

Please sign in to comment.