In plot_spc, is slicing really needed?
Dear Philipp :-)
I found that dplyr::slice() sometimes returns an empty dataframe and then an empty plot from the plot_spc() function. So I checked the slice() function using the famous dataset, "mtcars" on several PCs. It works as intended on some PCs but it yields an empty dataframe on some others. I am still trying to figure out what causes the issue and my first guess is that this seems to happen when the PC has the settings in Korean.
Anyways I wonder if slicing spc_tbl by row index is really needed in plot_spc().
Thanks!
Hey Juhwan, ooh thanks for reporting. I will check this one and come back to you. Thanks :-)
have you checked out plot_spc_ext()?
hmm it might be locale related. What encoding are you using @tag-dad ? Guess you are on Win. What is your R version? It could be that slicing depends on grouping, which relies on character encoding working correctly.
Hi Philipp,
R version is 4.3.1. And below is the locale of R that I am running on: "LC_COLLATE=English_United States.utf8;LC_CTYPE=English_United States.utf8;LC_MONETARY=English_United States.utf8;LC_NUMERIC=C;LC_TIME=English_United States.utf8"
I thought it might be locale related as well but now not so sure. If I set slice = F, then spc_plot() works just fine as in the function, the line reads if (slice == TRUE) { spc_tbl <- dplyr::slice(spc_tbl) }.
Anyhows, I will be checking plot_spc_ext(). ;-) Thanks!
Hi Philipp,
R version is 4.3.1. And below is the locale of R that I am running on: "LC_COLLATE=English_United States.utf8;LC_CTYPE=English_United States.utf8;LC_MONETARY=English_United States.utf8;LC_NUMERIC=C;LC_TIME=English_United States.utf8"
I thought it might be locale related as well but now not so sure. If I set slice = F, then spc_plot() works just fine as in the function, the line reads if (slice == TRUE) { spc_tbl <- dplyr::slice(spc_tbl) }.
Anyhows, I will be checking plot_spc_ext(). ;-) Thanks!
Hey Juhwan, yeah then it seems not related directly to locale I guess ;-) but plot_spc_ext() is anyhow the better choice. If anything does not work as expected, just ping me here or via mail. Cheers
@tag-dad I will keep this bug open. Once I have time I will try to reproduce the error. Cheers
yeah you are prob. right. Can you do slice = FALSE to omit the issue?