Skip to content

Commit

Permalink
CRAN release work.
Browse files Browse the repository at this point in the history
Remove all cached data sets as well as vignettes and tests that depend
on them.
  • Loading branch information
ehrlinger committed Sep 7, 2016
1 parent 465d321 commit c270275
Show file tree
Hide file tree
Showing 120 changed files with 175 additions and 5,741 deletions.
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ Package: ggRandomForests
Type: Package
Title: Visually Exploring Random Forests
Version: 2.0.1
Date: 2016-08-10
Date: 2016-09-07
Author: John Ehrlinger <john.ehrlinger@gmail.com>
Maintainer: John Ehrlinger <john.ehrlinger@gmail.com>
License: GPL (>=3)
VignetteBuilder: knitr
URL: https://github.com/ehrlinger/ggRandomForests
BugReports: https://github.com/ehrlinger/ggRandomForests/issues
Description: Graphic elements for exploring Random Forests using the 'randomForest' or
'randomForestSRC' package for survival, regression and classification forests and
'ggplot2' package plotting.
Depends:
R (>= 3.1.0)
R (>= 3.1.0),
randomForestSRC (>= 1.5.5)
Imports:
randomForestSRC (>= 1.5.5),
randomForest,
ggplot2,
survival,
Expand Down
40 changes: 20 additions & 20 deletions R/cache_rfsrc_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
#' deal with thoses changes. We make the function available to end users to
#' create objects for further experimentation.
#'
#' There are five cached data set types:
#' '\itemize{
#' \item \code{\link{rfsrc_data}} - \code{\link[randomForestSRC]{rfsrc}} objects.
#' \item \code{\link{varsel_data}} - \code{\link[randomForestSRC]{var.select}}
#' minimal depth variable selection objects.
#' \item \code{\link{interaction_data}} -
#' \code{\link[randomForestSRC]{find.interaction}} minimal depth,
#' pairwise variable interaction matrices.
#' \item \code{\link{partial_data}} - \code{\link[randomForestSRC]{plot.variable}}
#' objects
#' (\code{partial=TRUE}) for partial variable dependence.
#' \item \code{\link{partial_coplot_data}} -
#' \code{\link[randomForestSRC]{plot.variable}} objects
#' (\code{partial=TRUE}) for partial variable dependence.
#' }
# There are five cached data set types:
# '\itemize{
# \item \code{\link{rfsrc_data}} - \code{\link[randomForestSRC]{rfsrc}} objects.
# \item \code{\link{varsel_data}} - \code{\link[randomForestSRC]{var.select}}
# minimal depth variable selection objects.
# \item \code{\link{interaction_data}} -
# \code{\link[randomForestSRC]{find.interaction}} minimal depth,
# pairwise variable interaction matrices.
# \item \code{\link{partial_data}} - \code{\link[randomForestSRC]{plot.variable}}
# objects
# (\code{partial=TRUE}) for partial variable dependence.
# \item \code{\link{partial_coplot_data}} -
# \code{\link[randomForestSRC]{plot.variable}} objects
# (\code{partial=TRUE}) for partial variable dependence.
# }
#'
#' For the following data sets:
#' #'\itemize{
Expand All @@ -46,11 +46,11 @@
#' @seealso \code{iris} \code{airq} \code{mtcars} \code{\link[MASS]{Boston}}
#' \code{\link[randomForestSRC]{pbc}}
#' \code{\link[randomForestSRC]{veteran}}
#' \code{\link{rfsrc_data}}
#' \code{\link{varsel_data}}
#' \code{\link{interaction_data}}
#' \code{\link{partial_data}}
#' \code{\link{partial_coplot_data}}
# \code{\link{rfsrc_data}}
# \code{\link{varsel_data}}
# \code{\link{interaction_data}}
# \code{\link{partial_data}}
# \code{\link{partial_coplot_data}}
#'
#' @importFrom randomForestSRC rfsrc var.select plot.variable find.interaction
#' @importFrom utils data
Expand Down
8 changes: 4 additions & 4 deletions R/calc_roc.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#'
#' @examples
#' ## Taken from the gg_roc example
#' # rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' data(rfsrc_iris)
#' rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' #data(rfsrc_iris)
#' gg_dta <- calc_roc.rfsrc(rfsrc_iris, rfsrc_iris$yvar, which.outcome=1, oob=TRUE)
#' gg_dta <- calc_roc.rfsrc(rfsrc_iris, rfsrc_iris$yvar, which.outcome=1, oob=FALSE)
#' @export
Expand Down Expand Up @@ -130,8 +130,8 @@ calc_roc <- calc_roc.rfsrc
#' @examples
#' ##
#' ## Taken from the gg_roc example
#' # rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' data(rfsrc_iris)
#' rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' #data(rfsrc_iris)
#'
#' \dontrun{
#' gg_dta <- gg_roc(rfsrc_iris, which.outcome=1)
Expand Down
3 changes: 2 additions & 1 deletion R/combine.gg_partial.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#' @importFrom parallel mclapply
#'
#' @examples
#' \dontrun{
#' # Load a set of plot.variable partial plot data
#' data(partial_pbc)
#'
Expand Down Expand Up @@ -61,7 +62,7 @@
#' ggpart[[ind]] <- NULL
#' }
#' plot(ggpart, panel=TRUE)
#'
#' }
#'
#' @export
combine.gg_partial <- function(x, y, lbls, ...){
Expand Down
12 changes: 6 additions & 6 deletions R/gg_error.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
#' ## ------------------------------------------------------------
#' ## ------------- iris data
#' ## You can build a randomForest
#' # rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' # ... or load a cached randomForestSRC object
#' data(rfsrc_iris, package="ggRandomForests")
#' # data(rfsrc_iris, package="ggRandomForests")
#'
#' # Get a data.frame containing error rates
#' gg_dta<- gg_error(rfsrc_iris)
Expand All @@ -73,7 +73,7 @@
#' # Plot the gg_error object
#' plot(gg_dta)
#' }
#'
#'\dontrun{
#' ## ------------- Boston data
#' data(rfsrc_Boston, package="ggRandomForests")
#'
Expand All @@ -82,7 +82,7 @@
#'
#' # Plot the gg_error object
#' plot(gg_dta)
#'
#'}
#' \dontrun{
#' ## ------------- mtcars data
#'
Expand All @@ -105,14 +105,14 @@
#' gg_dta <- gg_error(rfsrc_veteran)
#' plot(gg_dta)
#' }
#'
#'\dontrun{
#' ## ------------- pbc data
#' # Load a cached randomForestSRC object
#' data(rfsrc_pbc, package="ggRandomForests")
#'
#' gg_dta <- gg_error(rfsrc_pbc)
#' plot(gg_dta)
#'
#'}
#' @export gg_error gg_error.rfsrc gg_error.randomForest gg_error.randomForest.formula
gg_error <- function (object, ...) {
UseMethod("gg_error", object)
Expand Down
10 changes: 6 additions & 4 deletions R/gg_interaction.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#' ## ------------------------------------------------------------
#' ## find interactions, classification setting
#' ## ------------------------------------------------------------
#' \dontrun{
#' ## -------- iris data
#' ## iris.obj <- rfsrc(Species ~., data = iris)
#' ## TODO: VIMP interactions not handled yet....
Expand All @@ -66,7 +67,7 @@
#'
#' plot(gg_dta, xvar="Petal.Width")
#' plot(gg_dta, panel=TRUE)
#'
#' }
#' ## ------------------------------------------------------------
#' ## find interactions, regression setting
#' ## ------------------------------------------------------------
Expand All @@ -85,13 +86,13 @@
#'
#' plot(gg_dta, panel=TRUE)
#' }
#'
#' \dontrun{
#' ## -------- Boston data
#' data(interaction_Boston, package="ggRandomForests")
#' gg_dta <- gg_interaction(interaction_Boston)
#'
#' plot(gg_dta, panel=TRUE)
#'
#' }
#' \dontrun{
#' ## -------- mtcars data
#' data(interaction_mtcars, package="ggRandomForests")
Expand All @@ -107,12 +108,13 @@
#' ## data(pbc, package = "randomForestSRC")
#' ## pbc.obj <- rfsrc(Surv(days,status) ~ ., pbc, nsplit = 10)
#' ## interaction_pbc <- randomForestSRC::find.interaction(pbc.obj, nvar = 8)
#' \dontrun{
#' data(interaction_pbc, package="ggRandomForests")
#' gg_dta <- gg_interaction(interaction_pbc)
#'
#' plot(gg_dta, xvar="bili")
#' plot(gg_dta, panel=TRUE)
#'
#' }
#' \dontrun{
#' ## -------- veteran data
#' data(interaction_veteran, package="ggRandomForests")
Expand Down
13 changes: 7 additions & 6 deletions R/gg_minimal_depth.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#' ## ------------------------------------------------------------
#' ## classification example
#' ## ------------------------------------------------------------
#' ## -------- iris data
#'\dontrun{
#' ## -------- iris data
#' ## You can build a randomForest
#' # rfsrc_iris <- rfsrc(Species ~ ., data = iris)
#' # varsel_iris <- randomForestSRC::var.select(rfsrc_iris)
Expand All @@ -54,7 +55,7 @@
#'
#' # Plot the gg_minimal_depth object
#' plot(gg_dta)
#'
#' }
#' ## ------------------------------------------------------------
#' ## Regression example
#' ## ------------------------------------------------------------
Expand All @@ -71,13 +72,13 @@
#' # Plot the gg_minimal_depth object
#' plot(gg_dta)
#' }
#'
#' \dontrun{
#' ## -------- Boston data
#' data(varsel_Boston, package="ggRandomForests")
#'
#' # Get a data.frame containing error rates
#' plot(gg_minimal_depth(varsel_Boston))
#'
#' }
#' \dontrun{
#' ## -------- mtcars data
#' data(varsel_mtcars, package="ggRandomForests")
Expand All @@ -102,13 +103,13 @@
#' gg_dta <- gg_minimal_depth(varsel_veteran)
#' plot(gg_dta)
#' }
#'
#' \dontrun{
#' ## -------- pbc data
#' data(varsel_pbc, package="ggRandomForests")
#'
#' gg_dta <- gg_minimal_depth(varsel_pbc)
#' plot(gg_dta)
#'
#' }
#' @aliases gg_minimal_depth gg_minimal_depth.randomForest gg_minimal_depth.rfsrc
#'
#' @export
Expand Down
10 changes: 6 additions & 4 deletions R/gg_minimal_vimp.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' ## ------------------------------------------------------------
#' ## classification example
#' ## ------------------------------------------------------------
#' \dontrun{
#' ## -------- iris data
#' ## You can build a randomForest
#' # rfsrc_iris <- rfsrc(Species ~ ., data = iris)
Expand All @@ -47,7 +48,7 @@
#'
#' # Plot the gg_minimal_depth object
#' plot(gg_dta)
#'
#' }
#' ## ------------------------------------------------------------
#' ## Regression example
#' ## ------------------------------------------------------------
Expand All @@ -64,7 +65,7 @@
#' # Plot the gg_minimal_vimp object
#' plot(gg_dta)
#' }
#'
#' \dontrun{
#' ## -------- Boston data
#' data(varsel_Boston, package="ggRandomForests")
#'
Expand All @@ -73,7 +74,7 @@
#'
#' # Plot the gg_minimal_vimp object
#' plot(gg_dta)
#'
#' }
#' \dontrun{
#' ## -------- mtcars data
#' data(varsel_mtcars, package="ggRandomForests")
Expand All @@ -99,12 +100,13 @@
#' gg_dta <- gg_minimal_vimp(varsel_veteran)
#' plot(gg_dta)
#' }
#' \dontrun{
#' ## -------- pbc data
#' data(varsel_pbc, package="ggRandomForests")
#'
#' gg_dta <- gg_minimal_vimp(varsel_pbc)
#' plot(gg_dta)
#'
#' }
#' @aliases gg_minimal_vimp gg_minimal_vimp.randomForest gg_minimal_vimp.rfsrc
#' @export
gg_minimal_vimp <- function (object, ...) {
Expand Down
11 changes: 6 additions & 5 deletions R/gg_partial.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#' ## classification
#' ## ------------------------------------------------------------
#' ## -------- iris data
#'
#' \dontrun{
#' ## iris "Petal.Width" partial dependence plot
#' ##
#' # rfsrc_iris <- rfsrc(Species ~., data = iris)
Expand All @@ -60,7 +60,7 @@
#'
#' gg_dta <- gg_partial(partial_iris)
#' plot(gg_dta)
#'
#' }
#' ## ------------------------------------------------------------
#' ## regression
#' ## ------------------------------------------------------------
Expand All @@ -82,13 +82,13 @@
#' gg_dta[["Month"]] <- NULL
#' plot(gg_dta, panel=TRUE)
#' }
#'
#' \dontrun{
#' ## -------- Boston data
#' data(partial_Boston, package="ggRandomForests")
#'
#' gg_dta <- gg_partial(partial_Boston)
#' plot(gg_dta, panel=TRUE)
#'
#' }
#' \dontrun{
#' ## -------- mtcars data
#' data(partial_mtcars, package="ggRandomForests")
Expand Down Expand Up @@ -145,6 +145,7 @@
#' gg_dta.cat[["karno"]] <- gg_dta.cat[["diagtime"]] <- gg_dta.cat[["age"]] <- NULL
#' plot(gg_dta.cat, panel=TRUE, notch=TRUE)
#' }
#' \dontrun{
#' ## -------- pbc data
#' data("partial_pbc", package = "ggRandomForests")
#' data("varsel_pbc", package = "ggRandomForests")
Expand Down Expand Up @@ -173,7 +174,7 @@
#'
#' #plot(pbc_ggpart[["edema"]], panel=TRUE) #,
#' # notch = TRUE, alpha = .3, outlier.shape = NA)
#'
#' }
#' @aliases gg_partial gg_partial_list gg_partial.rfsrc gg_partial.randomForest
#' @name gg_partial
#' @name gg_partial_list
Expand Down
6 changes: 4 additions & 2 deletions R/gg_partial_coplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @importFrom parallel mclapply
#'
#' @examples
#' \dontrun{
#' # Load the forest
#' data(rfsrc_pbc, package="ggRandomForests")
#'
Expand All @@ -28,7 +29,7 @@
#'
#' # Create the conditional groups and add to the gg_variable object
#' copper_grp <- cut(ggvar$copper, breaks = copper_cts)
#'
#' }
#' \dontrun{
#' ## We would run this, but it's expensive
#' partial_coplot_pbc <- gg_partial_coplot(rfsrc_pbc, xvar = "bili",
Expand All @@ -37,12 +38,13 @@
#' time = 1,
#' show.plots = FALSE)
#' }
#' \dontrun{
#' ## so load the cached set
#' data(partial_coplot_pbc, package="ggRandomForests")
#'
#' # Partial coplot
#' plot(partial_coplot_pbc) #, se = FALSE)
#'
#' }
#'
#' @export
gg_partial_coplot.rfsrc <- function(object,
Expand Down
Loading

0 comments on commit c270275

Please sign in to comment.