Skip to content

Commit

Permalink
Merge branch 'add-get-type': Issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinsimpson committed Sep 27, 2018
2 parents b160098 + fed0df4 commit d6f62e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,14 @@
`get_config` <- function(penalty) {
attr(penalty, which = "mrf_config")
}

##' @title Extract the type of MRF from the penalty
##'
##' @param penalty an object of class `"mrf_penalty"`
##'
##' @return A length 1 character vector containing the type of MRF penalty.
##'
##' @export
`get_type` <- function(penalty) {
get_config(penalty)[["type"]]
}

0 comments on commit d6f62e3

Please sign in to comment.