Skip to content

Commit

Permalink
Resolved ropensci#45
Browse files Browse the repository at this point in the history
All zero variables causing error
  • Loading branch information
GShotwell committed May 29, 2017
1 parent 766cab0 commit e0071ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ n_complete <- function(x) {

inline_hist <- function(x) {
x <- x[!is.na(x)]
hist_dt <- table(cut(x, 10))
hist_dt <- hist_dt / max(hist_dt)
out <- 0
names(out) <- colformat::spark_bar(hist_dt)
if ( !all(x == 0)) {
hist_dt <- table(cut(x, 10))
hist_dt <- hist_dt / max(hist_dt)
names(out) <- colformat::spark_bar(hist_dt)
}
return(out)
}

Expand Down

0 comments on commit e0071ea

Please sign in to comment.