Using dplyr's filter function to pick rows from a data frame in R (CC161)

  Рет қаралды 8,613

Riffomonas Project

Riffomonas Project

Күн бұрын

Пікірлер: 21
@timmytesla9655
@timmytesla9655 2 жыл бұрын
Even though I know a lot of these functions, there is always something to learn in your videos. Thank you.
@Riffomonas
@Riffomonas 2 жыл бұрын
My pleasure! Thanks for watching
@Riffomonas
@Riffomonas 2 жыл бұрын
Want to improve your R skills? Check out my upcoming R workshops that are all taught via Zoom riffomonas.org/workshops/ and my weekly newsletter where you can get practice exercises riffomonas.org
@bhaskartigp
@bhaskartigp 2 жыл бұрын
One simple way to select multiple locations is using % in% . (location %in% c(“ United States “ , “ Canada “)
@Riffomonas
@Riffomonas 2 жыл бұрын
Thanks. Yep. We get that in another episode. Many ways to do the same thing in R!
@enrico2
@enrico2 Жыл бұрын
thank you, very useful!!
@tommy.h.descartes
@tommy.h.descartes 2 жыл бұрын
Hey I have some issues with the rename function. Gives me an error about plyr vs dplyr. Any help?
@Riffomonas
@Riffomonas 2 жыл бұрын
Hi Tommy - sorry, I'm not familiar with that error message. With dplyr's rename, it would be rename(dataframe, new_name=old_name)
@tommy.h.descartes
@tommy.h.descartes 2 жыл бұрын
@@Riffomonas thanks much. I have really been enjoying you videos.
@bulletkip
@bulletkip 2 жыл бұрын
@@tommy.h.descartes sometimes if you load plyr after dplyr in your script, you will get that error.
@bulletkip
@bulletkip 2 жыл бұрын
if you have to get around it, you can force it by calling dplyr directly: dplyr::rename(dataframe, new_name=old_name)
@cleoniceandradeholanda5757
@cleoniceandradeholanda5757 2 жыл бұрын
And what if I want to filter the last/max values of some countries that I have selected? for instance, I selected USA, UK, and FR. FR doesn't have day 2020-01-28 but has day 27. All the others have 28. How to make an object that filters USA and UK's values of day 28 and FR day 27?
@Riffomonas
@Riffomonas 2 жыл бұрын
Maybe try slice_max on the date column after grouping by country
@cleoniceandradeholanda5757
@cleoniceandradeholanda5757 2 жыл бұрын
@@Riffomonas Wow cool! I didn't know that one! It Worked! I used the slice to the people_vacinated column and came to the dates that had no NA value!!! Thank you so much!
@gustavgabrielsen8459
@gustavgabrielsen8459 Жыл бұрын
How do i filter two rows?
@Riffomonas
@Riffomonas Жыл бұрын
Sorry, I'm not sure what you mean. Do you want to get back two rows? If that's what you mean, then within a single filter function, I'd create one statement to get one of the rows back and then another statment to get the other back. Then I'd connect them with an or operator (i.e., |) like ... filter(statement_1 | statement_2)
Using dplyr's group_by function with and without summarize (CC233)
25:54
Riffomonas Project
Рет қаралды 4,9 М.
Angry Sigma Dog 🤣🤣 Aayush #momson #memes #funny #comedy
00:16
ASquare Crew
Рет қаралды 49 МЛН
小丑和白天使的比试。#天使 #小丑 #超人不会飞
00:51
超人不会飞
Рет қаралды 40 МЛН
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 45 МЛН
The magrittr and base R pipe: what's the difference? (CC241)
25:47
Riffomonas Project
Рет қаралды 5 М.
Using dplyr's join functions in R to filter and merge data frames (CC164)
13:19
Describe and Summarise your data
19:44
R Programming 101
Рет қаралды 54 М.
How to subset rows in R with filter()
14:03
Equitable Equations
Рет қаралды 3,7 М.
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 140 М.
Lubridate - how to manipulate date and time data in R
18:05
R Programming 101
Рет қаралды 11 М.