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

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

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
@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!
@Riffomonas
@Riffomonas 3 жыл бұрын
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
@enrico2
@enrico2 Жыл бұрын
thank you, very useful!!
@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!
@tommy.h.descartes
@tommy.h.descartes 3 жыл бұрын
Hey I have some issues with the rename function. Gives me an error about plyr vs dplyr. Any help?
@Riffomonas
@Riffomonas 3 жыл бұрын
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 3 жыл бұрын
@@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)
@gustavgabrielsen8459
@gustavgabrielsen8459 2 жыл бұрын
How do i filter two rows?
@Riffomonas
@Riffomonas 2 жыл бұрын
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
Рет қаралды 5 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 3,1 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 9 МЛН
Mastering {dplyr}: 50+ Data Wrangling Techniques!
17:35
yuzaR Data Science
Рет қаралды 5 М.
Describe and Summarise your data
19:44
R Programming 101
Рет қаралды 56 М.
How to subset rows in R with filter()
14:03
Equitable Equations
Рет қаралды 4,8 М.
Advanced Filtering in R (Or/And Conditions, Strings, Missing Values)
10:16
The magrittr and base R pipe: what's the difference? (CC241)
25:47
Riffomonas Project
Рет қаралды 5 М.
Tidyverse in R - tips & tricks
18:10
Tom Henry - data science with R
Рет қаралды 27 М.
Using dplyr's join functions in R to filter and merge data frames (CC164)
13:19