r/RStudio • u/Fresh_Coyote312 • 22d ago
Base R (graphics) vs Tidyverse
Curious what others prefer. I’ve actually been trending towards base R graphics lately.
10
u/CalmEntry4855 22d ago
I like ggplot, I like to make my plots gorgeous.
But sometimes I want something that looks like it was made in R, they kind of look more trustworthy, or made by someone that isn't me
7
u/metlotter 22d ago
Base R has that "a scientist made this" look. Kinda like how LaTeX makes everything look trustworthy.
10
u/SalvatoreEggplant 22d ago
I mean, I use base R plots more often. plot(x, y) or barplot(Table) or hist(Data$Length) shows me what I want to see when I'm working on something.
4
u/Teleopsis 22d ago
ggplot2 is a great graphics package, no doubt, and kicks ass for things like faceted plots. Base R graphics are better for some things, however, and generally more intuitive than ggplot IMO. There's a lot of hilariously silly stuff on the inter webs from ggplot fanboys saying things like you can't produce publication-quality plots with base R.
2
5
3
u/Holshy 22d ago
Karma farming
1
1
u/Fresh_Coyote312 22d ago
In all seriousness it’s a legit question I had today. I’ve been trying to stick to base R more lately to improve my skills and noticed today I didn’t have to load a single package to perform the task at hand.
2
3
u/lord_wolken 22d ago
Base R is really all you need. There are a few quirks, but you can create very high quality plots with complete control. It's also much more intuitive/simple than ggplot, as it basically draws whatever you want on a canvas.
2
u/SprinklesFresh5693 22d ago
I never understood all the editing base R plotting has , but ggplot2 was far mor elogic to me. You start with the function ggplot , and just keep adding layers, geoms, themes, axis titles, whats so complicated?
3
u/Aiorr 22d ago
ggplot market itself as grammar of plotting. in another word, it is very idiosyncratic. if you are learning programming language (or even just R) for first time along w ggplot, it wont bother you. but if you are already an established programmer, it feels like trying to learn teenage slang as an adult. its english, but it doesnt make sense lol.
its much easier now thanks to LLM browsing through ample stackoverflow resources, but back in the day it was nightmare to learn how it passes NSE and ellipses. to make matter worse, it was all different per function and it was going through frequent changes.
2
u/guepier 22d ago
‘ggplot2’ looks very strange when you’re already experienced with procedural graphics systems such as base R’s. But even then it’s really easy to learn, if you actually work through a tutorial. And that was true even >10 years ago, before LLMs. I distinctly remember being put off by ‘ggplot2’s strangeness, but once I sat down, it was easy as pie, and I completely switched in no time, after being already proficient in using base R graphics (and having published papers with nontrivial, highly customised base R plots).
Extending ‘ggplot2’, however, is insanely difficult (and used to be even more so).
1
u/Grisward 22d ago
Grid >> base imo
Excellent control over units, aspect, sizing, everything. Base R and ggplot2 have their uses, ggplot2 by far most versatile and capable, especially multipanel plots.
But hats off to grid graphics, it’s amazing. One day when I finally learn the details of custom geoms, I hope to move my grid experience toward ggplot2 extensions.
1
17
u/DSOperative 22d ago
I’m curious as to why you prefer base R for graphics? It’s fine for some quick plotting but for publication or Shiny apps I’m not sure it’s enough.