Skip to content

dump(<S7_object>)? #524

Description

@HenrikBengtsson

I'm late to the party, and sorry if I missed a discussion on this, but is there a way to dump() an S7 object? Attempting to do so gives:

> x <- S7::S7_object()
> dump("x", file = stdout())
x <-
<object>
Warning message:
In dump("x", file = stdout()) : deparse may be incomplete

which is not valid R code.

Ultimately, I want to create a minimal, valid S7_object object without using the 'S7' package. I want this in order to write a teeny 'codetools'-related unit test, without having to depend on the 'S7' package. Thus far, I know I can save an S7_object object to an RDS file, and obtain such a "creature" without having the 'S7' package installed, e.g.

> z <- readRDS("s7.rds")
> z
<object>
attr(,"class")
[1] "S7_object"

but it would be nice not to rely on a binary representation for my unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    base Rfeaturea feature request or enhancement

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions