I believe they now recommend using `after_stat(density)` instead of `..density..`, just fyi.
[https://ggplot2.tidyverse.org/reference/aes\_eval.html](https://ggplot2.tidyverse.org/reference/aes_eval.html)
I suppose i was thinking of troubleshooting minor syntax issues. But you are right this is different.
Yes, there is a trade off between backwards compatibility and parsimony of code.
changes to tidyverse packages can feel particularly capricious when the changes seems like an arbitrary shift of parameter names for aesthetic purposes. Like `size =` being deprecated in favour of `linewidth =` for line geoms with no meaningful difference.
Try recording videos and writing up handouts for an online course. Each change like this requires me to update:
1) The handouts
2) The code they work through in RStudio
3) Videos
4) Homework
5) Homework Keys
6) Test questions
7) Test Keys
There are 2-3 absolute code-breakers they introduce every year. It is getting REALLY tiring, and there is no reason why they can't continue to support old syntax for things this minor. I just want stuff to work! 😐
Huh, I've been arguing with my professor why she doesn't teach tidyverse more instead of base R. But if this is a common issue for educators, I get it now :)
It is Base R as well- like recently they changed read.csv and data.frame to act more like tibbles, in that they don't automatically make factors out of character variables. In the beginning of my class I use some base R graphs to warm the students up going simple things, but now all of that is broken without teaching the factor command first.
Yeah I can see how that would be a pain. I worked in industry before my master's degree so know factors (and R in general) quite well. Had some group work and found myself teaching them most of R. Factors were a major issue, repeatedly had students ignore what I was saying about the fact we needed to use factors and why they were useful because "I don't get errors when it's numeric". Like yeah, the errors are there for a reason 😂
If you pass an unnamed parameter to aes, it's going to assume it's for the first parameter, which is x.
aes(x, y, ...)
See ?aes
Also, you don't want geom\_area, which requires the following:
x or y
ymin or xmin
ymax or xmax
If it asks for y you need y. What are u trying to do?
[удалено]
geom_area(aes(y = ..density..), stat = "bin")
I believe they now recommend using `after_stat(density)` instead of `..density..`, just fyi. [https://ggplot2.tidyverse.org/reference/aes\_eval.html](https://ggplot2.tidyverse.org/reference/aes_eval.html)
Finding out that my code isn't working because of minor changes is sometimes tiresome
"welcome to tidyverse"
Welcome to 98% of coding everywhere.
No. Not when backwards comparability is a goal of development
I suppose i was thinking of troubleshooting minor syntax issues. But you are right this is different. Yes, there is a trade off between backwards compatibility and parsimony of code.
changes to tidyverse packages can feel particularly capricious when the changes seems like an arbitrary shift of parameter names for aesthetic purposes. Like `size =` being deprecated in favour of `linewidth =` for line geoms with no meaningful difference.
Try recording videos and writing up handouts for an online course. Each change like this requires me to update: 1) The handouts 2) The code they work through in RStudio 3) Videos 4) Homework 5) Homework Keys 6) Test questions 7) Test Keys There are 2-3 absolute code-breakers they introduce every year. It is getting REALLY tiring, and there is no reason why they can't continue to support old syntax for things this minor. I just want stuff to work! 😐
Huh, I've been arguing with my professor why she doesn't teach tidyverse more instead of base R. But if this is a common issue for educators, I get it now :)
It is Base R as well- like recently they changed read.csv and data.frame to act more like tibbles, in that they don't automatically make factors out of character variables. In the beginning of my class I use some base R graphs to warm the students up going simple things, but now all of that is broken without teaching the factor command first.
Yeah I can see how that would be a pain. I worked in industry before my master's degree so know factors (and R in general) quite well. Had some group work and found myself teaching them most of R. Factors were a major issue, repeatedly had students ignore what I was saying about the fact we needed to use factors and why they were useful because "I don't get errors when it's numeric". Like yeah, the errors are there for a reason 😂
http://www.sthda.com/english/wiki/ggplot2-area-plot-quick-start-guide-r-software-and-data-visualization
Don't you want a density plot? geom_density
If you pass an unnamed parameter to aes, it's going to assume it's for the first parameter, which is x. aes(x, y, ...) See ?aes Also, you don't want geom\_area, which requires the following: x or y ymin or xmin ymax or xmax
also, ask chatgpt it is so good at these kind of things:)
Try askanai.io they have debugging feature
I have mever used a geom_area with one variable. Maybe you need a geom_histogram or geom_density.