Skip to contents

This is going to be more of a restating/remixing of the S3 vignette in vctrs, rather than a how-to-use-something-in-this-package. Essentially, it’s a set of notes to myself as I figure out how best to present it.

First a couple of namespace directives:

usethis::use_package("vctrs")

Then, copy and paste into ussie-package.R:

#' Internal vctrs methods
#  TODO: ask why it's important that this be documented, i.e. why not
#  just `@import vctrs` in the `usethis namespace`?
#'
#' @import vctrs
#' @keywords internal
#' @name ussie-vctrs
NULL

We need to define some functions:

  • new_result(): low-level constructor
  • uss_result(): high-level constructor
  • format.ussie_result(): formatter
  • vec_ptype_abbr.ussie_result(), vec_ptype_fill.ussie_result(): format helpers