Skip to content

Commit ff9cae7

Browse files
committed
Fix: correct handling of factors on x-axis
1 parent 382f799 commit ff9cae7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: SuperPlotR
22
Title: Making SuperPlots in R
3-
Version: 0.0.5
3+
Version: 0.0.6
44
Authors@R:
55
person(given = "Stephen J",
66
family = "Royle",

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# SuperPlotR (development version)
22

3+
## SuperPlotR 0.0.6
4+
5+
* Fixed factoring bug.
6+
37
## SuperPlotR 0.0.5
48

59
* Added `plainplot` function for simple plots.

R/superplot.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ superplot <- function(df,
7171
}
7272

7373
# if the cond column is not character, convert it
74-
if (!is.character(df[[cond]])) {
74+
# but only if it is not already a factor
75+
if (!is.factor(df[[cond]]) && !is.character(df[[cond]])) {
7576
df[[cond]] <- as.character(df[[cond]])
7677
}
7778

0 commit comments

Comments
 (0)