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

Freezing upon encountering a plotting error #180

Closed
atakanekiz opened this issue May 24, 2019 · 1 comment
Closed

Freezing upon encountering a plotting error #180

atakanekiz opened this issue May 24, 2019 · 1 comment

Comments

@atakanekiz
Copy link

Hello,

Thanks for this great package. It makes plotting and making reports a breeze.

I have experienced an issue when I try to plot a big data frame and make a mistake in the code to generate the plot. I figure out why the code fails, and that's not the problem. However, while ggpubr is throwing an error explaining the mistake, it seems like it is still doing something in the background which freezes the RStudio session for some time.

I tried this with smaller data frames and it is not a problem then. But when you have hundreds of columns and thousands of rows it becomes a problem. Please see my reprex below. Any ideas how to prevent data processing when there is an error so it fails fast?

Best,
Atakan

library(ggpubr)
#> Loading required package: ggplot2
#> Loading required package: magrittr

set.seed(100)

dat_rows <- 25000
dat_cols <- 900
data_points <- dat_rows * dat_cols

test_dat <- data.frame(matrix(rnorm(data_points), 
                              nrow = dat_rows,
                              ncol = dat_cols))

test_dat$category <- sample(LETTERS, dat_rows, replace = T)


# This works
ggscatter(test_dat, x="X1", y="X2", color="category", legend="none")

## This fails and freezes the RStudio session for some time
# ggscatter(test_dat, x="X1", y="X2", color="category", legend="none", add="segment")
# > Error in match.arg(add) : 
# >  'arg' should be one of “none”, “reg.line”, “loess”

Created on 2019-05-24 by the reprex package (v0.2.1)

@kassambara
Copy link
Owner

fixed now, thanks

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