Skip to content

Conversation

@javierluraschi
Copy link
Contributor

Consider removing tibble dependency. Two PR are out for supporting R 3.0.0 in tibble and lazyeval:

hadley/lazyeval#87
tidyverse/tibble#187

However, we could take the code out from tibble if needed as well.

else if (df_print == "tibble")
else if (df_print == "tibble") {
if (!requireNamespace("tibble", quietly = TRUE))
stop("Printing 'tibble' without 'tibble' package available")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of making this a hard error we could just use the default print method (and maybe warn once per session)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinushey how do we usually warn once per session? By setting a global or there is a nicer way for doing this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A slightly cleaner implementation would be with a factory function e.g.

make_warning <- function(message) {
    message <- message
    warned <- FALSE
    function() {
        if (warned) return()
        warning(message)
        warned <<- TRUE
    }
}

tibble_warning <- make_warning("...")
tibble_warning()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think that if they ask for tibble and we can't provide it then we are just fine to error (I think this will be a very narrow case as tibble is installed with dplyr and won't be a common choice given that pagedtable is available).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kept as is.

R/html_paged.R Outdated
is_atomic(x) || is.list(x)
}

is_vector_s3 <- function(x) UseMethod("is_vector_s3")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinushey and @hadley Are we okay to have a package private S3 method here or could that interfere somehow with the tibble exported method of the same name? We could just rename it to is_s3_vector and/or just implement it with a switch/case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjallaire just in case, renamed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd need to experiment to check - S3 + namespaces is still a little hairy. Definitely safer to rename.

@jjallaire
Copy link
Member

Yes, I'd say let's not use S3 here.

On Thu, Nov 3, 2016 at 7:20 AM, Hadley Wickham notifications@github.com
wrote:

@hadley commented on this pull request.

In R/html_paged.R #853:

  • dim_desc <- function(x) {
  • dim <- dim(x) %||% length(x)
  • format_dim <- vapply(dim, big_mark, character(1))
  • format_dim[is.na(dim)] <- "??"
  • paste0(format_dim, collapse = " \u00d7 ")
  • }
  • is_atomic <- function(x) {
  • is.atomic(x) && !is.null(x)
  • }
  • is_vector <- function(x) {
  • is_atomic(x) || is.list(x)
  • }
  • is_vector_s3 <- function(x) UseMethod("is_vector_s3")

I'd need to experiment to check - S3 + namespaces is still a little hairy.
Definitely safer to rename.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#853, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGXx8QnW4HgCmDURW-5BnbHIhlj67jTks5q6cOUgaJpZM4Kn1E8
.

@javierluraschi
Copy link
Contributor Author

K, S3 removed.

@jjallaire jjallaire merged commit 1783a1d into master Nov 3, 2016
@krlmlr
Copy link
Contributor

krlmlr commented Jan 4, 2017

FWIW, I'm planning to support R 3.0.0 in tibble 1.3.0 which will be out soon.

@yihui yihui deleted the bugfix/no-tibble branch February 25, 2017 17:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants