From 78d9f2b0b24131b5ce2230eb3c2c9f93620b10d9 Mon Sep 17 00:00:00 2001 From: Josiah Parry Date: Mon, 28 Oct 2024 09:28:48 -0400 Subject: [PATCH] Mention in doc that `new_rcrd()` requires a format method (#1954) --- R/type-rcrd.R | 6 ++++++ man/new_rcrd.Rd | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/R/type-rcrd.R b/R/type-rcrd.R index faa3a5888..c45728549 100644 --- a/R/type-rcrd.R +++ b/R/type-rcrd.R @@ -8,6 +8,12 @@ #' length, like [POSIXlt], but where the organisation should be considered #' an implementation detail invisible to the user (unlike a [data.frame]). #' +#' @details +#' Record-style objects created with [new_rcrd()] do not do much on their own. +#' For instance they do not have a default [format()] method, which means printing +#' the object causes an error. See [Record-style objects](https://vctrs.r-lib.org/articles/s3-vector.html?q=record#record-style-objects +#' for details on implementing methods for record vectors. +#' #' @param fields A list or a data frame. Lists must be rectangular #' (same sizes), and contain uniquely named vectors (at least #' one). `fields` is validated with [df_list()] to ensure uniquely diff --git a/man/new_rcrd.Rd b/man/new_rcrd.Rd index 62f1b3238..05705629d 100644 --- a/man/new_rcrd.Rd +++ b/man/new_rcrd.Rd @@ -25,4 +25,10 @@ classes that can naturally be decomposed into multiple vectors of the same length, like \link{POSIXlt}, but where the organisation should be considered an implementation detail invisible to the user (unlike a \link{data.frame}). } +\details{ +Record-style objects created with \code{\link[=new_rcrd]{new_rcrd()}} do not do much on their own. +For instance they do not have a default \code{\link[=format]{format()}} method, which means printing +the object causes an error. See \link{Record-style objects}(https://vctrs.r-lib.org/articles/s3-vector.html?q=record#record-style-objects +for details on implementing methods for record vectors. +} \keyword{internal}