Skip to content
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

stat_ecdf() not currently working on provided examples on Ubuntu run RStudio server #5336

Closed
mariadelmarq opened this issue Jun 26, 2023 · 2 comments

Comments

@mariadelmarq
Copy link

I found a problem with stat_ecdf().

I expected the provided examples to work, however I get the error:

Warning: Computation failed in `stat_ecdf()`
Caused by error:
! attempt to apply non-function

Here is the code to reproduce the bug:

# copy your code to the clipboard and run:
library(ggplot2)
set.seed(1)
df <- data.frame(
  x = c(rnorm(100, 0, 3), rnorm(100, 0, 10)),
  g = gl(2, 100)
)
ggplot(df, aes(x)) +
  stat_ecdf(geom = "step")

If I put it into reprex::reprex(), then it works, but if I try to run it in my RStudio server console, or within an RMarkdown file, I get the error described above. Is it possible I'm missing some Ubuntu library?

@teunbrand
Copy link
Collaborator

Hi there,

It seems unlikely that you'd need additional system libraries, calculating eCDFs should work. Does the problem occur when you run this code in a new R session or knit a very minimal Rmarkdown file?

@mariadelmarq
Copy link
Author

Thanks for your response, @teunbrand . Yesterday it didn't work in the console, in a minimal Rmarkdown file, or even by clicking on "Run examples" in the help at the bottom right. Today it works! I have no idea what happened, so sorry to waste your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants