Skip to content

Commit

Permalink
fix for #17
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed Aug 2, 2017
1 parent 1d1a0ed commit 96f3200
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion R/ggbarplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ ggbarplot_core <- function(data, x, y,

add <- setdiff(add, .center)
names(data_sum)[which(names(data_sum) == .center)] <- y
data_sum[, x] <- as.factor(data_sum[, x])
# data_sum[, x] <- as.factor(data_sum[, x])
if(inherits(xx, c("character", "numeric")))
data_sum[, x] <- .select_vec(data_sum, x) %>% as.factor()

}
else data_sum <- data
Expand Down
6 changes: 3 additions & 3 deletions R/ggline.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ ggline_core <- function(data, x, y, group = 1,
xx <- .select_vec(data, x)
if(inherits(xx, c("character", "numeric")))
data[, x] <- .select_vec(data, x) %>% as.factor()

error.plot = error.plot[1]
plot_type <- match.arg(plot_type)
if("none" %in% add) add <- "none"
Expand All @@ -210,7 +209,6 @@ ggline_core <- function(data, x, y, group = 1,

if(any(.summary_functions() %in% add)) {
data_sum <- desc_statby(data, measure.var = y, grps = grouping.vars)

summary.funcs <- intersect(.summary_functions(), add)
if(length(summary.funcs) > 1)
stop("Only one summary function is allowed. ",
Expand All @@ -222,7 +220,9 @@ ggline_core <- function(data, x, y, group = 1,

add <- setdiff(add, .center)
names(data_sum)[which(names(data_sum) == .center)] <- y
data_sum[, x] <- as.factor(data_sum[, x])
# data_sum[, x] <- as.factor(data_sum[, x])
if(inherits(xx, c("character", "numeric")))
data_sum[, x] <- .select_vec(data_sum, x) %>% as.factor()
}
else data_sum <- data

Expand Down

0 comments on commit 96f3200

Please sign in to comment.