Skip to content

Commit

Permalink
fix pretty.names = FALSE in plotThreshVsPerf (#1168)
Browse files Browse the repository at this point in the history
fix for #1167
  • Loading branch information
zmjones authored and larskotthoff committed Aug 18, 2016
1 parent 1525ff0 commit 2e52b97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/generateThreshVsPerf.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ plotThreshVsPerf = function(obj, measures = obj$measures,
if (pretty.names) {
mnames = replaceDupeMeasureNames(measures, "name")
colnames(obj$data) = mapValues(colnames(obj$data), names(measures), mnames)
} else {
mnames = names(measures)
}

data = setDF(melt(as.data.table(obj$data), measure.vars = mnames, variable.name = "measure", value.name = "performance", id.vars = id.vars))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_base_generateThreshVsPerf.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test_that("generateThreshVsPerfData", {
rdesc = makeResampleDesc("CV", iters = 2L)
r = resample(lrn, binaryclass.task, rdesc)
pvs = generateThreshVsPerfData(r, list(tpr, fpr))
plotThreshVsPerf(pvs)
plotThreshVsPerf(pvs, pretty.names = FALSE)
ggsave(path)
doc = XML::xmlParse(path)
#expect_that(length(XML::getNodeSet(doc, grey.xpath, ns.svg)), equals(length(pvs$measures)))
Expand Down

0 comments on commit 2e52b97

Please sign in to comment.