RelatedRecords {laminr} | R Documentation |
RelatedRecords
Description
A container for accessing records with a one-to-many or many-to-many relationship.
Methods
Public methods
Method new()
Creates an instance of this R6 class. This class should not be instantiated directly,
but rather by connecting to a LaminDB instance using the connect()
function.
Usage
RelatedRecords$new(instance, registry, field, related_to, api)
Arguments
instance
The instance the records list belongs to.
registry
The registry the records list belongs to.
field
The field associated with the records list.
related_to
ID or UID of the parent that records are related to.
api
The API for the instance.
Method df()
Get a data frame summarising records in the registry
Usage
RelatedRecords$df(limit = 100, verbose = FALSE)
Arguments
limit
Maximum number of records to return
verbose
Boolean, whether to print progress messages
Returns
A data.frame containing the available records
Method print()
Print a RelatedRecords
Usage
RelatedRecords$print(style = TRUE)
Arguments
style
Logical, whether the output is styled using ANSI codes
Method to_string()
Create a string representation of a RelatedRecords
Usage
RelatedRecords$to_string(style = FALSE)
Arguments
style
Logical, whether the output is styled using ANSI codes
Returns
A cli::cli_ansi_string
if style = TRUE
or a character vector