R/view-coerce.R

#' @include utils.R
#' @importFrom methods as<-
NULL

# Coercion to viewId
setAs(from = "numeric", to = "viewId", def = simpleCoerceData)
setAs(from = "character", to = "viewId", def = simpleCoerceData)

setAs(from = "gaView", to = "viewId",
      def = function(from, to) {
        as(from$id, "viewId")
      },
      replace = function(from, value) {
        from$id <- as(value, "viewId")
      }
)

Try the ganalytics package in your browser

Any scripts or data that you put into this service are public.

ganalytics documentation built on May 2, 2019, 8:34 a.m.