New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in min(c(x, xmin), na.rm = TRUE) : invalid 'type' (list) of argument #2610

Closed
karawoo opened this Issue May 15, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@karawoo
Member

karawoo commented May 15, 2018

#2584

Problem occurs in: FourCSeq, Rariant, RiboProfiling, Single.mTEC.Transcriptomes

From a quick look it seems that some interaction with ggbio might be the cause

@karawoo karawoo self-assigned this May 15, 2018

@hadley hadley added this to the v2.3.0 milestone May 15, 2018

@karawoo

This comment has been minimized.

Member

karawoo commented May 16, 2018

I believe this is coming up in ggbio's autoplot method. A reprex from ggbio docs, unfortunately not that minimal:

library("ggbio")
library("GenomicRanges")
set.seed(123)
gr.b <- GRanges(
  seqnames = "chr1",
  IRanges(
    start = seq(1, 100, by = 10),
    width = sample(4:9, size = 10, replace = TRUE)
  ),
  score = rnorm(10, 10, 3),
  value = runif(10, 1, 100)
)

p1 <- autoplot(gr.b, geom = "bar")
#> use score as y by default
#> Error in min(c(x, xmin), na.rm = TRUE): invalid 'type' (list) of argument

Created on 2018-05-15 by the reprex package (v0.2.0).

I think this is a tidyeval side effect, but I'm coming up against the limits of my ability to figure it out. I'm hoping I've narrowed it down enough that @hadley or @lionel- can point me in the right direction for the next step.

In the following line, ggbio looks up xmin values in the layer data: https://github.com/tengfei/ggbio/blob/fa214327b31bc0ecc9cfaf69e94a84d458c01e2c/R/utils.R#L138

With ggplot2 2.2.1, layer$mapping$xmin was a name, and this line got the relevant column of data out of the layer data data frame. In 2.2.1.9000 layer$mapping$xmin is a quosure, eval() doesn't have any effect as far as I can tell, and then finding the minimum value fails.

@hadley

This comment has been minimized.

Member

hadley commented May 16, 2018

Yes, that's a tidy eval issue, so we can just describe in a bit more detail in the breaking changes. I'll do that tomorrow — thanks for the exploration!

@karawoo

This comment has been minimized.

Member

karawoo commented May 16, 2018

👍 we should make sure to notify ggbio even though revdepcheck doesn't flag it (I guess because it has no tests or examples). I'm pretty sure the rest of these packages are inheriting the problem from there.

@hadley

This comment has been minimized.

Member

hadley commented May 16, 2018

@karawoo do you have time to finish this off today? It just needs a PR to docs mention this error under the tidy eval bullet. (No worries if not, I'll try and do later this afternoon).

@karawoo

This comment has been minimized.

Member

karawoo commented May 16, 2018

Yeah I can do it this evening

karawoo added a commit to karawoo/ggplot2 that referenced this issue May 17, 2018

@hadley hadley closed this in #2619 May 17, 2018

hadley added a commit that referenced this issue May 17, 2018

@maureenbug

This comment has been minimized.

maureenbug commented Aug 2, 2018

Hi, I was wondering if this was fixed, because I'm still running into this issue (even with a fresh RStudio restart and re-installation of packages), and don't really see a work around.

Thanks!

PS I only ran into this problem once I had to restart RStudio to update some packages... seemed like the package update was the problem (which, based on what was said above makes sense)

@batpigandme

This comment has been minimized.

Member

batpigandme commented Aug 3, 2018

The change is a breaking change in ggplot2, so in terms of an update with a “fix”, you should look to ggbio.

@maureenbug

This comment has been minimized.

maureenbug commented Aug 3, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment