Comments (10)
Some more insights:
If I replace the id
function used in join_keys
with somewhat heavier dplyr machinery, it works:
https://github.com/jmbuhr/ggplot2/blob/2e4206d99036e62c615da8a69e124832da94716c/R/compat-plyr.R#L128-L140
id_like <- function(.variables, drop = FALSE) {
unique_rows <- dplyr::distinct(.variables) |>
dplyr::mutate(id = dplyr::row_number())
n <- nrow(unique_rows)
res <- .variables |>
dplyr::left_join(unique_rows) |>
dplyr::pull(id)
attr(res, "n") <- n
res
}
This would of course break other usecases of the id
function, so it's not a fix, but it further isolates the problem.
from ggplot2.
I've run the example in the repo you linked to, but I'm not confronted with this error on Win11.
If you think something is wrong with ggplot2:::join_keys()
, you might be able to show what kind of inputs give faulty outputs directly using that function.
from ggplot2.
It's stranger than that. The same input sometimes works and sometimes fails. I expanded https://github.com/jmbuhr/ggplot-na-issue and rendered it on the workstation on which I observe the issue: http://jmbuhr.de/ggplot-na-issue/
And what happens is that when I execute the same function with the same inputs I sometimes get different outputs.
from ggplot2.
Narrowed it down the the matrix multiplication in id
res <- c((mat - 1L) %*% combs + 1L)
Both inputs stay the same, but the output varies on one machine...
from ggplot2.
Non deterministic output of matrix multiplications sounds like a recipe for disaster. I am clueless as to why that would happen on some machines.
from ggplot2.
So it's definitely the matrix multiplication... and the problem happens with options(matprod = "default")
, but vanishes with options(matprod = "internal")
: http://jmbuhr.de/ggplot-na-issue/minimal.html
Any idea what could make BLAS behave in such a way? The input matrices don't have any NA, NaN or Infs.
from ggplot2.
I will close this here, as it is certainly not a ggplot issue, but I hope you don't mind if I leave this open just a couple of days in the hopes that someone happens to have an idea.
from ggplot2.
I think I'd help to post this on stackoverflow or posit community to reach a wider audience than just those people that read ggplot2 issues.
from ggplot2.
Solved! sessionInfo()
revealed that the machine in question was using intel's math libraries libmkl
while all the others are using openblas
.
For future reference, switching can be done globally under linux with
sudo update-alternatives --config libblas.so.3-x86_64-linux-gnu
(for blas) and
sudo update-alternatives --config liblapack.so.3-x86_64-linux-gnu
(for lapack).
I still don't know, why intel's libraries produced the issue, but I'm just happy it works now.
from ggplot2.
Thank you for your hints :)
from ggplot2.
Related Issues (20)
- Documentation: relate `width`/`height` to position aesthetics
- MIssing axis when breaks = NULL
- User friendly breaks and labels for scale_*_time HOT 2
- Error bar line ends are not centered and have variable width when using geom_errorbar with position_jitterdodge HOT 1
- When setting "scales" in facet_grid, the horizontal justification of the axis labels shifts among the panels HOT 7
- More informative names for gradient scales
- Should `coord_trans` be renamed to `coord_transform` for API consistency? HOT 2
- `geom_sf_text()` and `geom_sf_label()` forcing the display of x and y axis labels HOT 2
- `stat_bin()` calculates wrong numbers when a `geom_col()` with custom `data` is present HOT 4
- geom_segment and geom_curve discrepancy HOT 1
- Problem of hjust in legend.text in ggplot2 v3.5.0 HOT 2
- Error using `after_stat(ecdf)` in `geom_ribbon()` HOT 1
- Swedish characters incorrectly shown in ggplot title HOT 4
- Should all scales expose the `aesthetics` parameter?
- Could support the use of function factories like `scales::pal_hue()` and `scales::pal_viridis()`? HOT 1
- Error when using scales::breaks_extended() in minor_breaks: "the condition has length > 1" HOT 3
- Could the NA default colour be set for a discrete scale where it is wanted to set colours for multiple levels? HOT 2
- Feature request: reassemble the ggplot object after `ggplot_build` HOT 1
- partial match (vp$just --> 'justification') HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggplot2.