From fa59ae8e448f484c5530a7c9f8098264803031bf Mon Sep 17 00:00:00 2001 From: Sebastian Kopf Date: Thu, 24 Apr 2014 19:30:44 -0700 Subject: [PATCH] add label to exported methods --- NAMESPACE | 1 + R/show.R | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index e69ffbf..bb9d125 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/show.R b/R/show.R index 2af9476..136b7f2 100644 --- a/R/show.R +++ b/R/show.R @@ -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(...)) @@ -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(