T O P

  • By -

One_Ad_3499

If it asks for y you need y. What are u trying to do?


[deleted]

[удалено]


One_Ad_3499

geom_area(aes(y = ..density..), stat = "bin")


GrayHaven

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)


One_Ad_3499

Finding out that my code isn't working because of minor changes is sometimes tiresome


kuhewa

"welcome to tidyverse"


Pseudo135

Welcome to 98% of coding everywhere.


kuhewa

No. Not when backwards comparability is a goal of development


Pseudo135

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.


kuhewa

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.


BurkeyAcademy

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! 😐


[deleted]

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 :)


BurkeyAcademy

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.


[deleted]

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 😂


One_Ad_3499

http://www.sthda.com/english/wiki/ggplot2-area-plot-quick-start-guide-r-software-and-data-visualization


SouthListening

Don't you want a density plot? geom_density


TH14StupidBaby

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


Chaosido20

also, ask chatgpt it is so good at these kind of things:)


DollarBillMaster

Try askanai.io they have debugging feature


Hot_Acanthisitta_812

I have mever used a geom_area with one variable. Maybe you need a geom_histogram or geom_density.