Skip to content

Modify tbl_df subclass print in a package #650

@urswilke

Description

@urswilke

Not sure if this topic belongs here and rather a comment than an issue. I was struggling to have a customized print of a tibble subclass "my_subclass" in a package using pillar.

If I understand correctly, the solution was to add these roxygen2 comments (and then devtools::document()):

#' @importFrom
#' @export

for instance

#' @importFrom pillar tbl_sum
#' @export
tbl_sum.my_subclass <- function(x, ...) {
  c("custom_title_string")
}

I was just wondering if it might be worth to add such a comment to the docs, because I lost too much time with this. For further explanation you can also check out this dummy package that I made to test this and which helped me to find the solution (the R6 part there isn't relevant for this topic I think).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions