diff --git a/R/randtest.R b/R/randtest.R index a2a42ba..962da50 100755 --- a/R/randtest.R +++ b/R/randtest.R @@ -97,11 +97,13 @@ randtest = function(x, y, ncomp = 15, center = T, scale = F, nperm = 1000, #' label for x axis #' @param ylab #' label for y axis +#' @param ... +#' other optional arguments #' #' @details #' See examples in help for \code{\link{randtest}} function. #' -plotHist.randtest = function(obj, comp = NULL, main = NULL, xlab = 'Test statistic', ylab = 'Frequency') +plotHist.randtest = function(obj, comp = NULL, main = NULL, xlab = 'Test statistic', ylab = 'Frequency', ...) { if (is.null(comp)) comp = obj$ncomp.selected @@ -139,11 +141,13 @@ plotHist.randtest = function(obj, comp = NULL, main = NULL, xlab = 'Test statist #' label for x axis #' @param ylab #' label for y axis +#' @param ... +#' other optional arguments #' #' @details #' See examples in help for \code{\link{randtest}} function. #' -plotCorr.randtest = function(obj, comp = NULL, main = NULL, xlab = expression(r^2), ylab = 'Test statistic') +plotCorr.randtest = function(obj, comp = NULL, main = NULL, xlab = expression(r^2), ylab = 'Test statistic', ...) { if (is.null(comp)) comp = obj$ncomp.selected @@ -154,16 +158,19 @@ plotCorr.randtest = function(obj, comp = NULL, main = NULL, xlab = expression(r^ data = list(cbind(obj$corrperm[, comp]^2, obj$statperm[, comp]), cbind(1, obj$stat[, comp])) fitdata = rbind(apply(data[[1]], 2, mean), data[[2]]) - mdaplotg(data, type = 'p', main = main, xlab = xlab, ylab = ylab) + mdaplotg(data, type = 'p', main = main, xlab = xlab, ylab = ylab, ...) mdaplot.showRegressionLine(fitdata, col = rgb(0.6, 0.6, 0.6), lty = 2, lwd = 0.75) } #' Plot for randomization test results #' +#' @method plot randtest +#' @S3method plot randtest +#' #' @description #' Makes a bar plot with alpha values for each component. #' -#' @param obj +#' @param x #' results of randomization test (object of class `randtest`) #' @param main #' main title for the plot @@ -171,14 +178,17 @@ plotCorr.randtest = function(obj, comp = NULL, main = NULL, xlab = expression(r^ #' label for x axis #' @param ylab #' label for y axis +#' @param ... +#' other optional arguments #' #' @details #' See examples in help for \code{\link{randtest}} function. #' -plot.randtest = function(obj, main = 'Alpha', xlab = 'Components', ylab = '') +plot.randtest = function(x, main = 'Alpha', xlab = 'Components', ylab = '', ...) { + obj = x mdaplot(t(rbind(1:length(obj$alpha), obj$alpha)), show.lines = c(NA, 0.05), type = 'h', - main = main, xlab = xlab, ylab = ylab) + main = main, xlab = xlab, ylab = ylab, ...) } #' Summary method for randtest object diff --git a/man/mdaplotg.Rd b/man/mdaplotg.Rd index 7e48b1d..52bcc52 100755 --- a/man/mdaplotg.Rd +++ b/man/mdaplotg.Rd @@ -11,7 +11,7 @@ Plotting function for several sets of objects \usage{ mdaplotg(data, type = 'p', pch = 16, lty = 1, lwd = 1, bwd = 0.8, legend = NULL, - xlab = NA, ylab = NA, main = NULL, labels = NULL, + xlab = NULL, ylab = NULL, main = NULL, labels = NULL, ylim = NULL, xlim = NULL, colmap = 'default', legend.position = "topright", single.x = T, show.legend = T, show.labels = F, show.lines = F, show.grid = T, diff --git a/man/plot.randtest.Rd b/man/plot.randtest.Rd index 64bc86b..03a8111 100644 --- a/man/plot.randtest.Rd +++ b/man/plot.randtest.Rd @@ -4,17 +4,19 @@ \alias{plot.randtest} \title{Plot for randomization test results} \usage{ -\method{plot}{randtest}(obj, main = "Alpha", xlab = "Components", - ylab = "") +\method{plot}{randtest}(x, main = "Alpha", xlab = "Components", ylab = "", + ...) } \arguments{ -\item{obj}{results of randomization test (object of class `randtest`)} +\item{x}{results of randomization test (object of class `randtest`)} \item{main}{main title for the plot} \item{xlab}{label for x axis} \item{ylab}{label for y axis} + +\item{...}{other optional arguments} } \description{ Makes a bar plot with alpha values for each component. diff --git a/man/plotCorr.randtest.Rd b/man/plotCorr.randtest.Rd index 2cd6ab9..b2b77e7 100644 --- a/man/plotCorr.randtest.Rd +++ b/man/plotCorr.randtest.Rd @@ -5,7 +5,7 @@ \title{Correlation plot for randomization test results} \usage{ \method{plotCorr}{randtest}(obj, comp = NULL, main = NULL, - xlab = expression(r^2), ylab = "Test statistic") + xlab = expression(r^2), ylab = "Test statistic", ...) } \arguments{ \item{obj}{results of randomization test (object of class `randtest`)} @@ -17,6 +17,8 @@ \item{xlab}{label for x axis} \item{ylab}{label for y axis} + +\item{...}{other optional arguments} } \description{ Makes a plot with statistic values vs. coefficient of determination between permuted diff --git a/man/plotHist.randtest.Rd b/man/plotHist.randtest.Rd index 81e012a..e8e1de5 100644 --- a/man/plotHist.randtest.Rd +++ b/man/plotHist.randtest.Rd @@ -5,7 +5,7 @@ \title{Histogram plot for randomization test results} \usage{ \method{plotHist}{randtest}(obj, comp = NULL, main = NULL, - xlab = "Test statistic", ylab = "Frequency") + xlab = "Test statistic", ylab = "Frequency", ...) } \arguments{ \item{obj}{results of randomization test (object of class `randtest`)} @@ -17,6 +17,8 @@ \item{xlab}{label for x axis} \item{ylab}{label for y axis} + +\item{...}{other optional arguments} } \description{ Makes a histogram for statistic values distribution for particular component, also diff --git a/man/randtest.Rd b/man/randtest.Rd index 415be6c..de1822e 100755 --- a/man/randtest.Rd +++ b/man/randtest.Rd @@ -3,8 +3,8 @@ \title{Randomization test for PLS regression} \usage{ - randtest = function(x, y, ncomp = 15, center = T, scale = F, nperm = 1000, - sig.level = 0.05, silent = TRUE) +randtest(x, y, ncomp = 15, center = T, scale = F, nperm = 1000, + sig.level = 0.05, silent = TRUE) } \description{ @@ -73,7 +73,7 @@ x = simdata$spectra.c x = prep.snv(x) ## Run the test and show summary -r = randtest(x, y, ncomp = 5, nperm = 2000, silent = F) +r = randtest(x, y, ncomp = 5, nperm = 2000, silent = FALSE) summary(r) ## Show plots