Using ggplot2 to group x-axis discrete values into subgroups (CC133)

  Рет қаралды 5,965

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 16
@Riffomonas
@Riffomonas 3 жыл бұрын
What other questions do you have about using facet_wrap?
@djangoworldwide7925
@djangoworldwide7925 2 жыл бұрын
Is facet grid the best thing ever? Yes!
@niceday2015
@niceday2015 2 жыл бұрын
Thank you again, and it is a gem for students to have lectures like this from a Master.
@Riffomonas
@Riffomonas 2 жыл бұрын
You're very welcome!
@djangoworldwide7925
@djangoworldwide7925 2 жыл бұрын
I love your detailed tutorials. Maybe one day you'll have me as your Postdoc ;) Id like to point out that in 6:25 you could rename your columns from the select function (which is not trivial since it's defined as selective, not operative), so the %>% rename is unnecessary...
@Riffomonas
@Riffomonas 2 жыл бұрын
Hah! Yeah sometime since this video was made I started using select to rename columns
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Pat, Again a very nice sequence of related videos. One thing I noticed in the weather data I used was there were were years that had few daily measurements. After some thinking about this I decided to figure out how to find the years with most missing days. I thought it might be helpful to others to share this so here is the code: my_weather %>% count(year = year(date)) %>% ggplot(aes(x = year, y = n - 365)) + geom_line() And I found some "bad" years. Next I decide to extract those years with the day counts. my_weather %>% count(year = year(date)) %>% arrange(n) I had nine years with measurements less than 360. The most obvious were the terminal year (start and finish) which is not surprising. So what do we do? Toss those years? Or do set a mark of say no more than 20% missing? A better approach might be to do an running window functions such as those found in the slider packge and aggregate 2-3 days. Just a thought.
@Riffomonas
@Riffomonas 2 жыл бұрын
Good stuff. Keep in mind that NA might mean zero. I’d dig into the documentation deeper if this is an important point for you. Also if a year is completely absent it won’t show up as a zero - it won’t show up at all
@ahmed007Jaber
@ahmed007Jaber 2 жыл бұрын
Thank u for this Pat Got an idea how to combine progress bars with list.files? I got some directories on onedrive which have large and many files that take ages to read in as it automatically download them
@Riffomonas
@Riffomonas 2 жыл бұрын
Sorry no idea
@KN-tx7sd
@KN-tx7sd 2 жыл бұрын
Hi Pat, will it be possible to label the x-axis labels with two different colors, say genus as grey and genus+fit as dodgerblue? I tried using element_text. However it seems element_text has some issues as its returns this error message, Vectorized "Warning message: input to `element_text()` is not officially supported. Results may be unexpected or may change in future versions of ggplot2". Is there a way to circumvent this problem? I even tried the element markdown option. It also doesn't help much. Many thanks for your help.
@Riffomonas
@Riffomonas 2 жыл бұрын
I think the easiest would be to use element_markdown from ggtext and then use an html to set the text color to what you want it to be in the label
@GabrielMorenoHagelsieb
@GabrielMorenoHagelsieb 3 жыл бұрын
How the hell did you learn all of those details? :D
@Riffomonas
@Riffomonas 3 жыл бұрын
Practice! 😂
@sven9r
@sven9r 3 жыл бұрын
What about Rainbow parentheses @ pat ? :D Again thank you wonderful inside of your process!
@Riffomonas
@Riffomonas 3 жыл бұрын
some day ... I could use all the help I can get!
Applying the DRY principle to repetitive R code (CC132)
25:56
Riffomonas Project
Рет қаралды 1,9 М.
Recreating a grouped and labelled barplot in R with ggplot2 (CC308)
47:05
Я сделала самое маленькое в мире мороженое!
00:43
Кушать Хочу
Рет қаралды 4,9 МЛН
Как не носить с собой вещи
00:31
Miracle
Рет қаралды 1,2 МЛН
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 125 МЛН
How to understand R code written by someone else (CC131)
36:53
Riffomonas Project
Рет қаралды 2,4 М.
Change Title, Axis labels, legends, Scaling (ggplot2)
12:52
BioinfQuests
Рет қаралды 9 М.
Showing groups on a scatter plot for an ordination using ggplot2 (CC079)
30:32
Double group on x axis with ggplot
32:08
Spencer Schien
Рет қаралды 4,1 М.
Я сделала самое маленькое в мире мороженое!
00:43
Кушать Хочу
Рет қаралды 4,9 МЛН