Skip to content

Commit

Permalink
add label to exported methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Kopf committed Apr 25, 2014
1 parent 7ffb710 commit fa59ae8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exportMethods(as.value)
exportMethods(as.weight)
exportMethods(as.weighted_value)
exportMethods(fractionate)
exportMethods(label)
exportMethods(mass_balance)
exportMethods(shift_reference)
exportMethods(weight)
5 changes: 5 additions & 0 deletions R/show.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ setMethod("unit", "Intensity", function(object) object@unit)

#' Get the full label of an isotope data object
#' @export
#' @method label
#' @examples
#' \dontrun{
#' label(ratio(...))
Expand All @@ -72,6 +73,10 @@ setMethod("unit", "Intensity", function(object) object@unit)
#' }
setGeneric("label", function(object) standardGeneric("label"))

#' @export
#' @method label
setMethod("label", "ANY", function(object) stop("label() not defined for objects of type ", class(object)))

# helper
iso_label <- function(object, show_compound = TRUE) {
paste(c(
Expand Down

0 comments on commit fa59ae8

Please sign in to comment.