Skip to content

Commit

Permalink
Bug fixes for 2.3 CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastand committed Dec 16, 2018
1 parent 2dcc5a5 commit dfc3282
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions R/interpret.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ plot.interpret <- function(x, include_intercept = FALSE, max_char = 40,

ats <- attributes(x)

if ( (is.data.frame(x) && names(x) != c("variable", "coefficient") ) ||
!is.data.frame(x))
if (!is.data.frame(x))
stop("x must be a data frame from interpret, or at least look like one!")
if (any(names(x) != c("variable", "coefficient")))
stop("x must be a data frame from interpret, or at least look like one!")

if (!include_intercept)
Expand Down
5 changes: 3 additions & 2 deletions R/missingness.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ plot.missingness <- function(x, remove_zeros = FALSE, max_char = 40,
if (inherits(x, "missingness") && !is.data.frame(x))
x <- data.frame(variable = names(x), percent_missing = x)

if ( (is.data.frame(x) && names(x) != c("variable", "percent_missing") ) ||
!is.data.frame(x))
if (!is.data.frame(x))
stop("x must be a data frame from missingness, or at least look like one!")
if (any(names(x) != c("variable", "percent_missing")))
stop("x must be a data frame from missingness, or at least look like one!")

if (remove_zeros)
Expand Down
5 changes: 3 additions & 2 deletions R/variable_importance.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ plot.variable_importance <- function(x,
print = TRUE,
... ) {

if ( (is.data.frame(x) & names(x) != c("variable", "importance") ) ||
!is.data.frame(x))
if (!is.data.frame(x))
stop("x must be a data frame from get_variable_importance, or at least look like one!")
if (any(names(x) != c("variable", "importance")))
stop("x must be a data frame from get_variable_importance, or at least look like one!")

if (title == "model") {
Expand Down

0 comments on commit dfc3282

Please sign in to comment.