Skip to content

Commit d725cac

Browse files
authored
fixed issue that if categories where factors, the dots would not show…
fixed issue that if categories where factors, the dots would not show…
2 parents 7b88205 + 2eb98b9 commit d725cac

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: loreplotr
22
Type: Package
33
Title: Draw logistic regression plots in R (Title Case)
4-
Version: 0.2.0
4+
Version: 0.2.1
55
Author: Sebastian Proost
66
Maintainer: Sebastian Proost <sebastian.proost@gmail.com>
77
Description: More about what it does (maybe more than one line)

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import(effects)
88
import(ggplot2)
99
import(nnet)
1010
import(tidyr)
11+
importFrom(dplyr,mutate)
1112
importFrom(magrittr,"%>%")
1213
importFrom(stats,anova)
1314
importFrom(stats,predict)

R/loreplotr.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ plot_area <- function(df, x, y, draw_dots=TRUE, dots_shape=21, dots_fill="white"
133133
#' @return ggplot2 plot
134134
#' @importFrom magrittr %>%
135135
#' @import ggplot2
136+
#' @importFrom dplyr mutate
136137
#' @examples
137138
#' library(dplyr)
138139
#' library(loreplotr)
@@ -146,6 +147,7 @@ loreplotr <- function(df, x, y, draw_dots=TRUE, dots_shape=21, dots_fill="white"
146147
validate_input(df, x, y)
147148

148149
g = df %>%
150+
mutate(across(c(y), ~as.character(.))) %>% # Force the categories to be characters (required for adding dots)
149151
plot_area(x, y, draw_dots = draw_dots, dots_shape=dots_shape, dots_fill=dots_fill, dots_colour=dots_colour, dots_size=dots_size, dots_alpha=dots_alpha)
150152

151153
return(g)

0 commit comments

Comments
 (0)