Skip to content

Commit

Permalink
exported plotting functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
markvanderloo committed Aug 5, 2016
1 parent 838394f commit a5fd357
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pkg/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ URL: https://github.com/markvanderloo/rtrim
BugReports: https://github.com/markvanderloo/rtrim/issues
Date: 2015-06-12
Suggests:
testthat
testthat,
knitr,
rmarkdown
RoxygenNote: 5.0.1
VignetteBuilder: knitr
1 change: 1 addition & 0 deletions pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

S3method(coef,trim)
S3method(gof,trim)
S3method(plot,trim.overall)
S3method(print,trim.coef)
S3method(print,trim.gof)
S3method(print,trim.index)
Expand Down
12 changes: 10 additions & 2 deletions pkg/R/trim_post.R
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ print.trim.wald <- function(x,...) {
#' Extract information of TRIM overall slope
#'
#' @param x TRIM output object
#' @param which Selector to choose between "imputed" or "model" counts
#' @param which Choose between "imputed" or "model" counts
#'
#' @return a list containing information overall slope coefficients (\code{coef}),
#' the p-value of the overall slope (\code{p}),
Expand Down Expand Up @@ -558,7 +558,15 @@ print.trim.overall <- function(x,...) {
#-------------------------------------------------------------------------------
# Plot

plot.trim.overall <- function(X, imputed=TRUE, ...) {
#' Plot overall slope
#'
#' @param x An object of class \code{trim.overall} (returned by \code{\link{overall}})
#' @param imputed Toggle to show imputed counts
#' @param ... Further options passed to \code{\link[graphics]{plot}}
#'
#' @export
plot.trim.overall <- function(x, imputed=TRUE, ...) {
X <- x
title <- attr(X, "title")

J <- X$J
Expand Down
5 changes: 5 additions & 0 deletions pkg/R/trim_workhorse.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ trim_estimate <- local({
stopifnot(class(site.id) %in% c("integer","character","factor"))
stopifnot(length(site.id)==n)

if (length(covars)>0){
message("Covariates are not implemented net and wil currently be ignored")
}

# \verb!model! should be in the range 1 to 3
model <- model[1]
stopifnot(model %in% 1:3)

# Convert time and site to factors, if they're not yet
Expand Down

0 comments on commit a5fd357

Please sign in to comment.