Skip to content

Commit

Permalink
small changes to help text for v. 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Kucheryavskiy authored and Sergey Kucheryavskiy committed Jan 15, 2015
1 parent 908b094 commit c8b18d4
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
22 changes: 16 additions & 6 deletions R/randtest.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -154,31 +158,37 @@ 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
#' @param xlab
#' 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
Expand Down
2 changes: 1 addition & 1 deletion man/mdaplotg.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions man/plot.randtest.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion man/plotCorr.randtest.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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`)}
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion man/plotHist.randtest.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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`)}
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions man/randtest.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c8b18d4

Please sign in to comment.