From 1ff4e344a8dcb42ca6ecbb3d5cd788c1d820ff00 Mon Sep 17 00:00:00 2001 From: Max Kuhn Date: Tue, 22 May 2018 18:14:21 +0000 Subject: [PATCH] version 1.1-7 --- DESCRIPTION | 17 ++--- MD5 | 23 +++---- NAMESPACE | 5 ++ R/bookTheme.R | 145 ++++++++++++++++++++++--------------------- R/easyBoundaryFunc.R | 31 +++++---- R/getPackages.R | 18 +++--- R/panels.R | 66 +++++++++++--------- R/permuteRelief.R | 23 ++++--- R/quadBoundaryFunc.R | 29 ++++----- R/scriptLocation.R | 5 +- R/transparentTheme.R | 70 ++++++++++----------- README.md | 2 + inst/NEWS.Rd | 2 +- 13 files changed, 232 insertions(+), 204 deletions(-) create mode 100644 README.md diff --git a/DESCRIPTION b/DESCRIPTION index 6bd6014..9c882df 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,17 +1,18 @@ Package: AppliedPredictiveModeling Type: Package Title: Functions and Data Sets for 'Applied Predictive Modeling' -Version: 1.1-6 -Date: 2014-07-24 +Version: 1.1-7 +Date: 2018-05-22 Author: Max Kuhn, Kjell Johnson Maintainer: Max Kuhn -Description: A few functions and several data set for the Springer book 'Applied Predictive Modeling' +Description: A few functions and several data set for the Springer book 'Applied Predictive Modeling'. URL: http://appliedpredictivemodeling.com/ Depends: R (>= 2.10) -Imports: CORElearn, MASS, plyr, reshape2 -Suggests: caret (>= 6.0-22), lattice, ellipse -License: GPL -Packaged: 2014-07-25 13:37:54 UTC; kuhna03 +Imports: CORElearn, MASS, plyr, reshape2, lattice, ellipse +Suggests: caret (>= 6.0-22) +License: GPL-2 +RoxygenNote: 6.0.1 NeedsCompilation: no +Packaged: 2018-05-22 19:03:00 UTC; max Repository: CRAN -Date/Publication: 2014-07-25 18:42:22 +Date/Publication: 2018-05-22 19:14:21 UTC diff --git a/MD5 b/MD5 index fb96d54..9c0c196 100644 --- a/MD5 +++ b/MD5 @@ -1,13 +1,14 @@ -b956c4b3e5aad17e35ac120a5d5f59d3 *DESCRIPTION -03e5df17ec09e62322761dbf70cd3a8a *NAMESPACE -e4e564d2188913c297d854a86868bd37 *R/bookTheme.R -538821ec8c21e26d4b936611aa157bc4 *R/easyBoundaryFunc.R -f4e5463cfcc4da4261f8014b1426c10c *R/getPackages.R -35a9e06d580a6ed8b8d98c9f3c0a61eb *R/panels.R -57c3568c0838c1acba62489985f0dea9 *R/permuteRelief.R -5996be154af6ef121fab077294b2e5e0 *R/quadBoundaryFunc.R -d35f915bd2268cbb07c258bd8fce5c50 *R/scriptLocation.R -98d928db47d8347a4f886f0c8e4adde1 *R/transparentTheme.R +d9a47751fc337024c1a1c41e1da27221 *DESCRIPTION +f78a4ad513d2c6c72c50fb7c8c3c4fa6 *NAMESPACE +4ba4117b0411d3dffc0016338e086487 *R/bookTheme.R +ba7591c480e18250a36afca890626919 *R/easyBoundaryFunc.R +4bcab4abad6714d7dded5c1bc3924c0c *R/getPackages.R +4eeffcbe6c341af031b5ca224ddc01e3 *R/panels.R +2cd8668d7140eff6b9bbb10e281ff643 *R/permuteRelief.R +f8804618082623af1ab53f6eda5d6c6e *R/quadBoundaryFunc.R +ea3ad783d73b8ecd91c3df840f944bfe *R/scriptLocation.R +b7ba633adffdafee73c75abba35be85c *R/transparentTheme.R +cb9165768774234eeda3f6e724fa4bae *README.md 8a34126ad3a2f9d077653b26d950dddb *data/AlzheimerDisease.RData fe3de40e923db3e0133b269f1610afa2 *data/ChemicalManufacturingProcess.RData ef3addd28ad9449688f0c33ba9bfc2d0 *data/FuelEconomy.RData @@ -21,7 +22,7 @@ e1590269851cf810fdffa832b6cf6d65 *data/schedulingData.RData 669172e9b524f9194a23fbc84a2816f8 *data/segmentationOriginal.RData 06780bd86a4db76cb2a8eb12ef107df7 *data/solubility.RData 5e5422a8c05125f3ab1822f6c525296a *data/twoClassData.RData -47ca37b7084f35df9345c9c5b6a3d461 *inst/NEWS.Rd +7973bb1a98c7ee6c2e08604fbd923d59 *inst/NEWS.Rd 55afb317aa767a6e82c6c52ee985563f *inst/chapters/02_A_Short_Tour.R 5a487c219abde639b85d7275c6a4bf31 *inst/chapters/02_A_Short_Tour.Rout ec4768cf8bf24124e998a1ce680dceb6 *inst/chapters/03_Data_Pre_Processing.R diff --git a/NAMESPACE b/NAMESPACE index 72bc2ef..5abcbd1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,8 @@ exportPattern("^[[:alpha:]]+") import(CORElearn, MASS, plyr, reshape2) +importFrom("grDevices", "rgb") +importFrom("stats", "runif", "sd") +importFrom("utils", "install.packages") +importFrom("lattice", "trellis.par.set", "trellis.par.get", "panel.xyplot") +importFrom("ellipse", "ellipse") diff --git a/R/bookTheme.R b/R/bookTheme.R index e70ce15..23c0bde 100644 --- a/R/bookTheme.R +++ b/R/bookTheme.R @@ -1,70 +1,75 @@ -bookTheme <- function(set = TRUE) - { - library(lattice) - theme <- list(plot.polygon = list(alpha = 1, col = "aliceblue", border = "black", lty = 1, lwd = 1), - background = list(col = "transparent"), - bar.fill = list(col = "#cce6ff"), - box.rectangle = list(col = "black"), - box.umbrella = list(col = "black"), - dot.line = list(col = "#e8e8e8"), - dot.symbol = list(col = "black"), - plot.line = list(col = "black", lwd = 1, lty = 1), - plot.symbol = list(col = "black", pch = 16), - regions = list(col = - c("#FEF8FA", "#FDF6F9", "#FBF5F9", "#FAF3F8", - "#F8F2F7", "#F7F0F7", "#F5EEF6", "#F4EDF5", - "#F2EBF5", "#F1EAF4", "#EFE8F3", "#EDE7F2", - "#ECE5F1", "#EAE4F1", "#E8E2F0", "#E6E1EF", - "#E4DFEE", "#E2DEED", "#E0DCEC", "#DEDAEB", - "#DCD9EA", "#D9D7E9", "#D7D6E8", "#D4D4E7", - "#D1D2E6", "#CED1E5", "#CCCFE4", "#C8CEE3", - "#C5CCE2", "#C2CAE1", "#BFC9E0", "#BBC7DF", - "#B8C5DF", "#B4C4DE", "#B1C2DD", "#ADC0DC", - "#A9BFDB", "#A6BDDA", "#A2BBD9", "#9EB9D9", - "#9BB8D8", "#97B6D7", "#93B4D6", "#8FB2D5", - "#8BB0D4", "#87AFD3", "#83ADD2", "#7FABD1", - "#7AA9D0", "#76A7CF", "#71A5CE", "#6CA3CC", - "#68A1CB", "#63A0CA", "#5D9EC9", "#589CC8", - "#539AC6", "#4E98C5", "#4996C4", "#4493C3", - "#3F91C1", "#3A8FC0", "#358DBF", "#308BBE", - "#2C89BD", "#2887BC", "#2385BB", "#1F83BA", - "#1C80B9", "#187EB7", "#157CB6", "#127AB5", - "#0F78B3", "#0D76B2", "#0A73B0", "#0971AE", - "#076FAC", "#066DAA", "#056AA7", "#0568A5") - ), - strip.shingle = list(col = c( - "#ff7f00", "#00ff00", "#00ffff", - "#ff00ff", "#ff0000", "#ffff00", "#0080ff")), - strip.background = list(col = c( - "#ffe5cc", "#ccffcc", "#ccffff", - "#ffccff", "#ffcccc", "#ffffcc", "#cce6ff")), - reference.line = list(col = "#e8e8e8"), - superpose.line = list( - col = c( - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black"), - lty = rep(1:6, each = 6)), - superpose.symbol = list( - pch = c( - 1, 4, 6, 0, 5, 17, - 4, 6, 0, 5, 17, 1, - 6, 0, 5, 17, 1, 4, - 0, 5, 17, 1, 4, 6, - 5, 17, 1, 4, 6, 0 , - 17, 1, 4, 6, 0, 5), - cex = rep(0.7, 6 * 6), - col = c( - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", - "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black"))) - - if(set) trellis.par.set(theme) - invisible(theme) - } +bookTheme <- function(set = TRUE){ + theme <- list( + plot.polygon = list(alpha = 1, col = "aliceblue", border = "black", lty = 1, lwd = 1), + background = list(col = "transparent"), + bar.fill = list(col = "#cce6ff"), + box.rectangle = list(col = "black"), + box.umbrella = list(col = "black"), + dot.line = list(col = "#e8e8e8"), + dot.symbol = list(col = "black"), + plot.line = list(col = "black", lwd = 1, lty = 1), + plot.symbol = list(col = "black", pch = 16), + regions = list(col = + c("#FEF8FA", "#FDF6F9", "#FBF5F9", "#FAF3F8", + "#F8F2F7", "#F7F0F7", "#F5EEF6", "#F4EDF5", + "#F2EBF5", "#F1EAF4", "#EFE8F3", "#EDE7F2", + "#ECE5F1", "#EAE4F1", "#E8E2F0", "#E6E1EF", + "#E4DFEE", "#E2DEED", "#E0DCEC", "#DEDAEB", + "#DCD9EA", "#D9D7E9", "#D7D6E8", "#D4D4E7", + "#D1D2E6", "#CED1E5", "#CCCFE4", "#C8CEE3", + "#C5CCE2", "#C2CAE1", "#BFC9E0", "#BBC7DF", + "#B8C5DF", "#B4C4DE", "#B1C2DD", "#ADC0DC", + "#A9BFDB", "#A6BDDA", "#A2BBD9", "#9EB9D9", + "#9BB8D8", "#97B6D7", "#93B4D6", "#8FB2D5", + "#8BB0D4", "#87AFD3", "#83ADD2", "#7FABD1", + "#7AA9D0", "#76A7CF", "#71A5CE", "#6CA3CC", + "#68A1CB", "#63A0CA", "#5D9EC9", "#589CC8", + "#539AC6", "#4E98C5", "#4996C4", "#4493C3", + "#3F91C1", "#3A8FC0", "#358DBF", "#308BBE", + "#2C89BD", "#2887BC", "#2385BB", "#1F83BA", + "#1C80B9", "#187EB7", "#157CB6", "#127AB5", + "#0F78B3", "#0D76B2", "#0A73B0", "#0971AE", + "#076FAC", "#066DAA", "#056AA7", "#0568A5") + ), + strip.shingle = list(col = c( + "#ff7f00", "#00ff00", "#00ffff", + "#ff00ff", "#ff0000", "#ffff00", "#0080ff") + ), + strip.background = list(col = c( + "#ffe5cc", "#ccffcc", "#ccffff", + "#ffccff", "#ffcccc", "#ffffcc", "#cce6ff") + ), + reference.line = list(col = "#e8e8e8"), + superpose.line = list( + col = c( + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black" + ), + lty = rep(1:6, each = 6)), + superpose.symbol = list( + pch = c( + 1, 4, 6, 0, 5, 17, + 4, 6, 0, 5, 17, 1, + 6, 0, 5, 17, 1, 4, + 0, 5, 17, 1, 4, 6, + 5, 17, 1, 4, 6, 0 , + 17, 1, 4, 6, 0, 5), + cex = rep(0.7, 6 * 6), + col = c( + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black", + "#053061", "#B2182B", "#F46D43", "#5E4FA2", "#66C2A5", "black" + ) + ) + ) + + if(set) trellis.par.set(theme) + invisible(theme) +} diff --git a/R/easyBoundaryFunc.R b/R/easyBoundaryFunc.R index b1620e0..23dfad6 100644 --- a/R/easyBoundaryFunc.R +++ b/R/easyBoundaryFunc.R @@ -1,15 +1,20 @@ -easyBoundaryFunc <- function(n, intercept = 0, interaction = 2) -{ - sigma <- matrix(c(2,1.3,1.3,2),2,2) - - tmpData <- data.frame(mvrnorm(n=n, c(0,0), sigma)) - xSeq <- seq(-4, 4, length=40) - plotGrid <- expand.grid(x = xSeq, y = xSeq) - zFoo <- function(x, y) intercept -4 * x + 4* y + interaction*x*y - z2p <- function(x) 1/(1+exp(-x)) - - tmpData$prob <- z2p(zFoo(tmpData$X1, tmpData$X2)) - tmpData$class <- factor(ifelse(runif(length(tmpData$prob)) <= tmpData$prob, "Class1", "Class2")) - tmpData + +easyBoundaryFunc <- function(n, + intercept = 0, + interaction = 2) { + sigma <- matrix(c(2, 1.3, 1.3, 2), 2, 2) + + tmpData <- data.frame(mvrnorm(n = n, c(0, 0), sigma)) + xSeq <- seq(-4, 4, length = 40) + plotGrid <- expand.grid(x = xSeq, y = xSeq) + zFoo <- function(x, y) + intercept - 4 * x + 4 * y + interaction * x * y + z2p <- function(x) + 1 / (1 + exp(-x)) + + tmpData$prob <- z2p(zFoo(tmpData$X1, tmpData$X2)) + tmpData$class <- + factor(ifelse(runif(length(tmpData$prob)) <= tmpData$prob, "Class1", "Class2")) + tmpData } diff --git a/R/getPackages.R b/R/getPackages.R index e231441..aecedfc 100644 --- a/R/getPackages.R +++ b/R/getPackages.R @@ -1,8 +1,8 @@ -getPackages <- function(chapter, ...) -{ - if(is.numeric(chapter)) chapter <- paste(chapter) +getPackages <- function(chapter, ...) { + if(is.numeric(chapter)) + chapter <- paste(chapter) pkg <- list() pkg[["2"]] <- c("earth", "caret", "lattice") pkg[["3"]] <- c("e1071", "caret", "corrplot") @@ -30,16 +30,16 @@ getPackages <- function(chapter, ...) pkg[["18"]] <- c("caret", "CORElearn", "corrplot", "pROC", "minerva") pkg[["19"]] <- c("caret", "MASS", "corrplot", "RColorBrewer", "randomForest", "kernlab", "klaR") - plist <- paste(paste("'", names(pkg), "'", sep = ""), collapse = ", ") - if(!any(chapter %in% names(pkg))) stop(paste("'chapter' must be: ", - paste(plist, collapse = ", ")), - sep = "") - + plist <- + paste(paste("'", names(pkg), "'", sep = ""), collapse = ", ") + if (!any(chapter %in% names(pkg))) + stop(paste("'chapter' must be: ", + paste(plist, collapse = ", "))) pkg <- unlist(pkg[chapter]) pkg <- pkg[!is.na(pkg)] pkg <- pkg[pkg != ""] pkg <- pkg[order(tolower(pkg))] - + install.packages(pkg, ...) } diff --git a/R/panels.R b/R/panels.R index d8d018f..266d13d 100644 --- a/R/panels.R +++ b/R/panels.R @@ -1,30 +1,38 @@ -upperp <- function(...) - { - library(ellipse) - args <- list(...) - circ1 <- ellipse(diag(rep(1, 2)), t = .1) - panel.xyplot(circ1[,1], circ1[,2], - type = "l", - lty = trellis.par.get("reference.line")$lty, - col = trellis.par.get("reference.line")$col, - lwd = trellis.par.get("reference.line")$lwd) - circ2 <- ellipse(diag(rep(1, 2)), t = .2) - panel.xyplot(circ2[,1], circ2[,2], - type = "l", - lty = trellis.par.get("reference.line")$lty, - col = trellis.par.get("reference.line")$col, - lwd = trellis.par.get("reference.line")$lwd) - circ3 <- ellipse(diag(rep(1, 2)), t = .3) - panel.xyplot(circ3[,1], circ3[,2], - type = "l", - lty = trellis.par.get("reference.line")$lty, - col = trellis.par.get("reference.line")$col, - lwd = trellis.par.get("reference.line")$lwd) - panel.xyplot(args$x, args$y, groups = args$groups, subscripts = args$subscripts) - } - -lowerp <- function(...) - { - - } +upperp <- function(...) { + args <- list(...) + circ1 <- ellipse(diag(rep(1, 2)), t = .1) + panel.xyplot( + circ1[, 1], + circ1[, 2], + type = "l", + lty = trellis.par.get("reference.line")$lty, + col = trellis.par.get("reference.line")$col, + lwd = trellis.par.get("reference.line")$lwd + ) + circ2 <- ellipse(diag(rep(1, 2)), t = .2) + panel.xyplot( + circ2[, 1], + circ2[, 2], + type = "l", + lty = trellis.par.get("reference.line")$lty, + col = trellis.par.get("reference.line")$col, + lwd = trellis.par.get("reference.line")$lwd + ) + circ3 <- ellipse(diag(rep(1, 2)), t = .3) + panel.xyplot( + circ3[, 1], + circ3[, 2], + type = "l", + lty = trellis.par.get("reference.line")$lty, + col = trellis.par.get("reference.line")$col, + lwd = trellis.par.get("reference.line")$lwd + ) + panel.xyplot(args$x, + args$y, + groups = args$groups, + subscripts = args$subscripts) +} +lowerp <- function(...) { + +} diff --git a/R/permuteRelief.R b/R/permuteRelief.R index 30234e5..1c1eb9c 100644 --- a/R/permuteRelief.R +++ b/R/permuteRelief.R @@ -1,25 +1,24 @@ permuteRelief <- -function(x, y, nperm = 100, ...) - { + function(x, y, nperm = 100, ...) { dat <- x dat$y <- y obs <- attrEval(y ~ ., data = dat, ...) permuted <- matrix(NA, ncol = length(obs), nrow = nperm) colnames(permuted) <- names(obs) - for(i in 1:nperm) - { - dat$y <- sample(y) - permuted[i,] <- attrEval(y ~ ., data = dat, ...) - } + for (i in 1:nperm) { + dat$y <- sample(y) + permuted[i,] <- attrEval(y ~ ., data = dat, ...) + } means <- colMeans(permuted) sds <- apply(permuted, 2, sd) permuted <- melt(permuted) names(permuted)[2] <- "Predictor" permuted$X1 <- NULL - list(standardized = (obs - means)/sds, - permutations = permuted, - observed = obs, - options = list(...)) + list( + standardized = (obs - means) / sds, + permutations = permuted, + observed = obs, + options = list(...) + ) } - diff --git a/R/quadBoundaryFunc.R b/R/quadBoundaryFunc.R index 1f2d093..6fdf2ad 100644 --- a/R/quadBoundaryFunc.R +++ b/R/quadBoundaryFunc.R @@ -1,15 +1,16 @@ -quadBoundaryFunc <- -function(n) -{ - sigma <- matrix(c(1,.7,.7,2),2,2) - - tmpData <- data.frame(mvrnorm(n=n, c(1,0), sigma)) - xSeq <- seq(-4, 4, length=40) - plotGrid <- expand.grid(x = xSeq, y = xSeq) - zFoo <- function(x, y) -1 - 2 * x - 0 * y - .2 * x^2 + 2 * y^2 - z2p <- function(x) 1/(1+exp(-x)) - - tmpData$prob <- z2p(zFoo(tmpData$X1, tmpData$X2)) - tmpData$class <- factor(ifelse(runif(length(tmpData$prob)) <= tmpData$prob, "Class1", "Class2")) - tmpData +quadBoundaryFunc <- function(n) { + sigma <- matrix(c(1, .7, .7, 2), 2, 2) + + tmpData <- data.frame(mvrnorm(n = n, c(1, 0), sigma)) + xSeq <- seq(-4, 4, length = 40) + plotGrid <- expand.grid(x = xSeq, y = xSeq) + zFoo <- function(x, y) + - 1 - 2 * x - 0 * y - .2 * x ^ 2 + 2 * y ^ 2 + z2p <- function(x) + 1 / (1 + exp(-x)) + + tmpData$prob <- z2p(zFoo(tmpData$X1, tmpData$X2)) + tmpData$class <- + factor(ifelse(runif(length(tmpData$prob)) <= tmpData$prob, "Class1", "Class2")) + tmpData } diff --git a/R/scriptLocation.R b/R/scriptLocation.R index 46afe37..201dbce 100644 --- a/R/scriptLocation.R +++ b/R/scriptLocation.R @@ -1,2 +1,3 @@ -scriptLocation <- function() system.file("chapters", package = "AppliedPredictiveModeling") - +scriptLocation <- + function() + system.file("chapters", package = "AppliedPredictiveModeling") diff --git a/R/transparentTheme.R b/R/transparentTheme.R index 86ccfed..08b0810 100644 --- a/R/transparentTheme.R +++ b/R/transparentTheme.R @@ -1,17 +1,16 @@ transparentTheme <- -function(set = TRUE, pchSize = 1, trans = .2) - { - library(lattice) - theme <- list(plot.polygon = list(alpha = 1, col = "aliceblue", border = "black", lty = 1, lwd = 1), - background = list(col = "transparent"), - bar.fill = list(col = "#cce6ff"), - box.rectangle = list(col = "black"), - box.umbrella = list(col = "black"), - dot.line = list(col = "#e8e8e8"), - dot.symbol = list(col = "black"), - plot.line = list(col = "black"), - plot.symbol = list(col = "black"), - regions = list(col = + function(set = TRUE, pchSize = 1, trans = .2) { + theme <- list( + plot.polygon = list(alpha = 1, col = "aliceblue", border = "black", lty = 1, lwd = 1), + background = list(col = "transparent"), + bar.fill = list(col = "#cce6ff"), + box.rectangle = list(col = "black"), + box.umbrella = list(col = "black"), + dot.line = list(col = "#e8e8e8"), + dot.symbol = list(col = "black"), + plot.line = list(col = "black"), + plot.symbol = list(col = "black"), + regions = list(col = c("#FEF8FA", "#FDF6F9", "#FBF5F9", "#FAF3F8", "#F8F2F7", "#F7F0F7", "#F5EEF6", "#F4EDF5", "#F2EBF5", "#F1EAF4", "#EFE8F3", "#EDE7F2", @@ -32,28 +31,29 @@ function(set = TRUE, pchSize = 1, trans = .2) "#1C80B9", "#187EB7", "#157CB6", "#127AB5", "#0F78B3", "#0D76B2", "#0A73B0", "#0971AE", "#076FAC", "#066DAA", "#056AA7", "#0568A5") - ), - strip.shingle = list(col = c( - "#ff7f00", "#00ff00", "#00ffff", - "#ff00ff", "#ff0000", "#ffff00", "#0080ff")), - strip.background = list(col = c( - "#ffe5cc", "#ccffcc", "#ccffff", - "#ffccff", "#ffcccc", "#ffffcc", "#cce6ff")), - reference.line = list(col = "#e8e8e8"), - superpose.line = list( - col = c( - rgb(1, 0, 0, trans), rgb(0, 0, 1, trans), - rgb(0.3984375, 0.7578125, 0.6445312, max(.6, trans)), - rgb(0, 0, 0, trans)), - lty = rep(1:2, 6)), - superpose.symbol = list( - pch = c(16, 15, 17, 18, 16), - cex = rep(pchSize, 5), - col = c( - rgb(1, 0, 0, trans), rgb(0, 0, 1, trans), - rgb(0.3984375, 0.7578125, 0.6445312, max(.6, trans)), - rgb(0, 0, 0, trans)))) - + ), + strip.shingle = list(col = c( + "#ff7f00", "#00ff00", "#00ffff", + "#ff00ff", "#ff0000", "#ffff00", "#0080ff")), + strip.background = list(col = c( + "#ffe5cc", "#ccffcc", "#ccffff", + "#ffccff", "#ffcccc", "#ffffcc", "#cce6ff")), + reference.line = list(col = "#e8e8e8"), + superpose.line = list( + col = c( + rgb(1, 0, 0, trans), rgb(0, 0, 1, trans), + rgb(0.3984375, 0.7578125, 0.6445312, max(.6, trans)), + rgb(0, 0, 0, trans)), + lty = rep(1:2, 6)), + superpose.symbol = list( + pch = c(16, 15, 17, 18, 16), + cex = rep(pchSize, 5), + col = c( + rgb(1, 0, 0, trans), rgb(0, 0, 1, trans), + rgb(0.3984375, 0.7578125, 0.6445312, max(.6, trans)), + rgb(0, 0, 0, trans))) + ) + if(set) trellis.par.set(theme, warn = FALSE) invisible(theme) } diff --git a/README.md b/README.md new file mode 100644 index 0000000..7e65739 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# AppliedPredictiveModeling +Data and code from Applied Predictive Modeling (2013) diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 80b8ad7..bdc83c1 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -1,6 +1,6 @@ \name{NEWS} \title{News for Package \pkg{AppliedPredictiveModeling}} -\newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}} +\newcommand{\cpkg}{\href{https://cran.r-project.org/package=#1}{\pkg{#1}}} \section{Changes in version 1.1-6}{