Skip to content

Commit

Permalink
added experimental plot method to lbj_logger
Browse files Browse the repository at this point in the history
  • Loading branch information
markvanderloo committed Oct 12, 2018
1 parent b0835c1 commit 521e812
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
version 0.2.7
- lbj_logger object now has an (experimental) $plot() method.

version 0.2.6
- New methods 'all' and 'any' for 'validation' objects
- New 'plot' method for 'validator' objects.
Expand Down
10 changes: 10 additions & 0 deletions pkg/R/lumberjack.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ lbj_rules <- setRefClass("lbj_rules",
cat("Logging object of class lbj_rules with the following logging info\n")
print(.self$log_data())
}
, plot = function(){
"plot rule comparisons"
pl <- getMethod("plot","validatorComparison")
log <- .self$log_data()
cmp <- t(log[-(1:3)])
class(cmp) <- c("validatorComparison", "array")
x <- gsub("\\(.*","",log$expression)
colnames(cmp) <- x
pl(cmp)
}
, fmsg = function(fmt,...){
if (.self$verbose){
message(sprintf(fmt,...))
Expand Down

0 comments on commit 521e812

Please sign in to comment.