10 data filtering tips using R programming. Use the tidyverse to filter and subset your data.
HTML-код
- Опубликовано: 15 июл 2024
- In this video you'll learn 10 different ways to filter and subset your data using R programming. This is an R programming for beginners video and forms part of a data cleaning and data manipulation series. If you are interested in statistics, data science, R programming or quantitative research, then this video is a must watch.
Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library
"Boom shaka laka!"
Thank you Greg, we appreciate these videos!
I was about to give up on learning R when I came across your videos. I'm finally making progress! Thanks so much.
Wonderful! glad to hear it
x2
@@RProgramming101 You're a lifesaver!👍👍👍👍😁😁😁🌐🌐.
there are tons of really smart people out there that can't teach, this man really knows how to teach, he understands learning.
So nice of you - thanks for the great feedback!
I'm following a course in Linkedin about mastering "R", however, I'm mastering it with your content instead, thanks so much !!!
That's a great compliment.
Amazing videos! Please don't stop doing these! they're so useful and well done
Please keep the videos coming my friend. You are providing an invaluable service, and the quality of these videos are top notch!
You're awesome been a teacher! Thank you.
Very informative and concise video! Please keep doing more!!
Greg, I've watched all your videos and they're so helpful! Would you be willing to create some videos highlighting different types of data visualization?
I found your videos very important as a beginner in using R. Thank you.
Great tutorial as always. Amazing filtering skills to command for any aspiring data analyst
Well explained, easy to understand . Thanks for you great effort!
you not only teach in a way very easy way to learn for anyone but you also make it fun so I want to learn more and more! Thank-you very much sir, God bless.
I am trying to work on a case study and this saved me so many hours of confusion and frustration. The filter part where are you added the == | sign was so helpful
Excellent !! Making it so easy to learn R. Thank you. Looking forward to more videos.
Thanks for the comment 😀. More videos to come.
Great to see you're still making videos, they are extremely helpful for getting to know R
Glad you like them! Glad it was helpful! Thank you :)
Information is presented with clarity and video is well produced.
Thanks.
thank you so much, so clear and informative
Sometimes when I get really stuck I wish I could just share my screen and ask you 100 questions, like right now for instance haha anyways thanks for videos they have been tremendously helpful!
Happy to help! You are so welcome!
Thank you so much!!!!! You just made my day with the "filter and between".
I'm so glad! Thank you!
Love the way you edit.
Thank you!
Really good channel, can't wait to see your next video. Thank you for sharing
Thank you so much! More video Please.
Bless you.
You're an outstanding teacher and sparked my interest in delving deeper into R. Profound regards.
Thanks for the feedback. Much appreciated!
Thank you so much! There's a ton of videos on how to remove NAs and change NAs. This was the first video that shows how to create a dataset with only NAs! Thank you
You're welcome! Thank you for the feedback, Brianne 👍👍
I didn't know about between() and near(). This is really helpful. Thank you very much!
Glad it was helpful!
It worked well for me, except one thing: after the exclamation mark, a space should be entered. Nice video's, Greg!
Thanks so much for such a helpful video! Would you mind making a video on how to make different types of plots in R?
5 min studying R used to blow off my mind, but now i actually enjoy R
Glad you enjoyed it!
Wow! Thank you so much. This has really helped me in my undergraduate studies :) I really appreciate it!!!
I'm so glad it helped! Thanks
You are amazing! 👏🏻👏🏻👏🏻👏🏻 Thanks for that. New subscriber here.
Very nice. Thanks -
Do more man, these videos are really good
Thanks. More to come!
Love this video! thanks
Glad you enjoyed it!
Very useful, thanks!
Glad it was helpful!
I recently started university and these videos are really really helpful!! Thank you☺️
You're so welcome!
Can you please make a video on joints and how to perform them in R because your explanation is outstanding, I must say! Please make a video on combining two tables with left join.
Boom shakalaka!! 🤣🤣🤣🤣New here and loving your contents
Wow, the NEAR function is very interesting. I was wondering how I could have R 'scan' a huge set of standard deviation values and determine those whos mean & medians stray out of a tolerance. 👍
Good job my friend!!!
Thank you! Cheers!
Gosh you are good at explaining this, thanks a bunch. Can you tell me what theme you use for Rstudio, really digging it!
Looks like "Chaos" to me
I just discovered your channel and I'm finding it not nearly as impossible to get myhead around R using Tidyverse. A challenge that I am having is filtering a dataset on year. I want to keep the last ten years of data. I don't have the vocabulary to dynamically filter. Ideally, if a new year is added to my dataset, then the last year will be dropped and the new year will be added to the analyses. Do you have any suggestions on how to filter when the values in the year column is unknown but I want the most recent ten?
Bro you're saving lifes
Glad it was helpful! Thank you :)
Great video!! What theme are you using in R studio?? Colors are very nice
Brilliant. You should have a faculty position at a University.
Thanks for the video, we can also use multiple filter clause
my_data %
select (name, sleep_total) %>%
filter (name %in% c("Cow", "Dog", "Horse") |
between(sleep_total, 16,18))
Oooh NICE example.. thanks !!!!
Hi, Greg. About your coding style, are the white spaces between arguments and symbols created automatically or you set style after coding? Many thanks.
Superb video sir. Thank you so much
But I'm stuck at how we can apply loop in filter function so that it can filter one thing and make a file and then filter next and make next file and so on. Please give solution sir!!!
Amazing content for learning R, thank you so much. Just a qq - is there an example of using a filter function with starts_with, ends_with, contains functions? Similar to how those functions are combined with the select function?
using stringr library, filter(df, str_detect(species, "^D")) , where ^D means starts with D
credits to @weecology
Good one. I am sure it there, filtering based on wildcard
I love your videos, for some reason "my_data
I am interested in learning how to weight data in R. Greg Martin, is there any chance you will cover data weighting in the future? (By the way I abbreviated my RUclips name to the first letter of my first name, Rob. That was unconnected to the fact I have taken an interest in learning R programming)
Thanks for the comment Rob. Yes, I’ll create a video on data weighting for sure. Thanks for the suggestion.
How can we export the results in for Use in presentation or the likes
In this example, if I wanted to filter for all observations with a name 'containing' the letters "ow" , how would that be possible?
sir how can we filter the values of coordinate pairs in loop.
Good job Greg,
Am surprised when you used:
filter(name %in% c("Cow", "Dog", "Horse")
The output:
Cow
Dog
Goat
How did "Horse" change to "Goat" ?
Ooooih!!! Well spotted!!! It was a post production editing mistake. I didn’t see it until now (blush)
how to get the "or" symbol ?
thank you
Very good video. I have noticed that you can't use a variable in filter () that is not included in the select() part. For example:
mydata%
select(name, order, bodywt, sleep_total) %>%
filter(is.na(conservation))
gives an error
Errore: Problem with `filter()` input `..1`.
x oggetto "conservation" non trovato
i Input `..1` is `is.na(conservation)`.
In sql you can filter for a variable even if itìs not included in the select clasue. It's strange.
Thanks for the comment Marco - what you can do is filter before the select (if you want to). Once you've used the select function in R, the dataset that you're using is changed and narrowed to only include those variables that you have selected.
I love you
A Horse is a Goat!
Thank….I have a question…How can I change the coulers of some sign like () or%>% like yours? Where is the setting the window of R?
With R studio open, Click on the "tools" tab and select "Global options". Then look for "Appearence" on the left hand side and click on it. Under the "Editor theme" option there is a wide range of themes to choose from. When you find one you like click on "Apply".
Thanks Theolan, for sharing your knowledge...I did it, and now I have a beautiful window in R Studio!
How to filter from a column only in english cos i got many texts in multiple languages
I get this error when filtering: unexpected input in "filter(year > 1995, country %in% c(“"
I don’t know why when I typed:
my_data %
select (name, sleep_total) %>%
filter (name == “Cow”|
name == “Dog”|
name == “Goat”)
I have to type again my_data to see the result
Also Appear two results Cow and Goat
Why not appears Dog’s result?
Boom shaka laka :)
😀
Boom shakalaka😂😂😂😂😂😂
Thank you for the video..
Is this correct? sorry my first time doing this
nv %
na.omit() %>%
group_by(vore) %>%
summarise(av_awake = mean(awake), av_sleep_total = mean(sleep_total)) %>%
arrange(av_awake, av_sleep_total) %>%
select(vore, av_awake, av_sleep_total )
boooom booom shaka laka
Please don't use the unfriendly sound while selecting or underlying something. It feels worst if someone has Hemdchens on.