aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2018-04-04 16:44:55 -0400
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2018-04-04 16:44:55 -0400
commitbff21e507e8b98a205517f2068f28a073dbaab22 (patch)
tree4e2e9d54fa24e87268c6b4d36782f1c046403de0
parentprovide longer title (diff)
downloadrgensvm-bff21e507e8b98a205517f2068f28a073dbaab22.tar.gz
rgensvm-bff21e507e8b98a205517f2068f28a073dbaab22.zip
bugfix for plotting
-rw-r--r--R/plot.gensvm.R5
1 files changed, 3 insertions, 2 deletions
diff --git a/R/plot.gensvm.R b/R/plot.gensvm.R
index 3f6f5d2..e05a690 100644
--- a/R/plot.gensvm.R
+++ b/R/plot.gensvm.R
@@ -129,8 +129,9 @@ plot.gensvm <- function(x, labels, newdata=NULL, with.margins=TRUE,
colors <- gensvm.plot.colors(fit$n.classes)
markers <- gensvm.plot.markers(fit$n.classes)
- col.vector <- colors[labels]
- mark.vector <- markers[labels]
+ indices <- match(labels, classes)
+ col.vector <- colors[indices]
+ mark.vector <- markers[indices]
if (fit$n.classes == 2)
S <- cbind(S, matrix(0, nrow(S), 1))