Video není dostupné.
Omlouváme se.
Manipulate your data. Data wrangling. R programmning for beginners.
Vložit
- čas přidán 18. 01. 2022
- If you are learning to use R programming for data analysis then you're going to love this video. It's an "R programming for beginners" video that deals with manipulating data. What does that mean? Well, before you can do any statistical analysis of your data, you'll need to get it into the right shape. You'll need to select variables and filter rows. You'll need to recode observations and sometimes create new variables.
In this video you'll learn about the mutate function to create new or change existing variables and the if_else function that can be used for conditional changes to observations. If you are learning data science, statistics or are doing quantitative analysis in your research using R, then this is an important step in your management and analysis of data. This video forms part of a series that includes, explore your data, clean your data, summarize your data, manipulate your data, visualize your data and then analyze your data with statistical and modeling techniques.
A huge thank you to Nested Knowledge for supporting the creation of this video. Nested Knowledge. Create and share your Systematic Review on the Internet nested-knowled...
Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library
I must say it, I was learning stuff on the internet for that past 20 years, I am 36 yo now. I have never seen better tutorials than yours. I feel you can teach anyone anything. Thank you very much for your work sir.
Wow, thanks! (that's the best feedback I've ever received) - much apprecaited.
Just wanna thank you for the great quality of the videos, im a Brazilian economist and i am looking to develop my habilities in data analysis. I'm doing the edx program of DS offered by the MIT, and honestly, your videos are better, a lot more content in less time, thanks you again, and keep up the amazing job if u can!!! cheers from Brazil!
Thanks for the feedback!
Thank you so much, Greg. Have never seen such an amazing instructor like you.
oh wow - that is a very nice compliment. much appreciated.
Recently finished my Google Certificate in Data Analsysis and your videos really helped me when it came to my project. I think my project was pretty rubbish but was pleased to get it done using R so thanks.
One point of major frustration was getting graphs to look how I wanted them to look. I ended up having to use re-order as they did not accept the arrange () function. I have sincd learned it has something to do with factors. The other thing I found difficult was figuring out the different types of data - continous versus discreet and how and when to use what graph, and why didn't R Color Brewer work for one graph but not the other ahahhhh. haha, Fond memories. Anyway, I am subsribed and look forward to future videos.
Thanks for the feedback Dan :)
Man I have been waiting a lot for your videos to learn R Programming
Because I couldn't find many resources as informative and structured as yours.
Please keep posting
Lots of Love from India ❤️
Thanks!!! More to come soon :)
Another concept made super duper easy... I am stealing this expression from you by the way. Thanks a lot. Really appreciate your content Dr.
Finally you come back we waiting for almost 3 weeks 😻
haha - more to come soon Max (I promise) :)
These tutes are fabulous. Thanks for taking the time to share your knowledge in such a great format. If you it fits in with your plans, a video on R equivalent of excel v-lookup to merge datasets and ways to compare two data frames would be super helpful. Thanks again.
Clearest, most succinct R tutorials I've seen on youtube. Great job sir!!
Wow, thanks!
By far the best R tutorial I've seen on CZcams. Man you are truly awesome. Your videos have made me understand R better than anything I've ever seen.
Excellent video!
I have become spoiled by your presentations and I for one have a difficult time watching other videos that lack the elegance and detail you give. Too many videos of "those who shall remain unnamed" don't bother explaining what they are doing and often supplied broken data sets.
By the way. I noticed that you did not save your data until the end. That might be worth pointing out to beginners since if you run the code and then do View() - then it appears that the changes one has made are not their (and they are not since they are not saved). Finally, great explanation on the pivot_wider/pivot_longer function. In reference to the latter I found it easier to simply type ....pivot_longer(!country, ...) and simply omit the country column rather trying to figure out how many year columns I had.
Please keep these coming!
Happy New Year and Thanks!
I'm here to sincerely thank you for these tutorials. I didn't know where to start with R. Then I came to CZcams and found your channel. I'm almost done with ALL your videos and I'm really grateful for them. So Thank You Sir!
Also: Tried to use the select() function with gapminder; failed. Took it as a challenge to know what the problem was...found that I need to run library (dplyr) together with library(gapminder) :)
Thank you for these tutorials!!!! They are amazing. I wouldn't have been able to finish my thesis without them!!!
Happy to help! You are so welcome!
Thank you, I have learnt so much from this video
Awesome! Can't wait for the next installation.
I am blown away! I have used Python but this is the most comfortable language easier than I thought thank you! Keep up the good work!
Thank you so much for this! Your videos are so detailed and easy to process.
Great tutorial as usual. I'm waiting for the analysis series. Thanks so much for your great videos.
i just love your videos more than anything else.
You are amazing
Very kind of you to say (thanks)
Great stuff. I enjoy your vids. Always learn something new.
you are a brilliant teacher thank you very much you make R super fun and easy 🌹🌹🌹🌹🌹🌹🌹🌹
thanks for the lovely feedback :) Much appreciated. Glad you like the content.
Great video!! Supper helpful. I have already learned a lot from you
Thank you for the feedback! Cheers
Grrat video. Congrats
"boomshakalaka" 😃))
Of course, I like it)
Thank you for this great tutorial lesson. 😉
These videos are good guideline for me.
Glad you liked it! Thank you too!
I love Greg's tutorials.
I'm glad my videos resonated with you and you found it relatable. Thanks for sharing your experience.
Very clear presentation. Thanks for this series 😀
You're most welcome
nice one
It would be a great help to learn the lubridate package for working with date/month/year or time series data from you. Quite a few CZcamsrs tried to explain it, but it was hard to follow them. Your tutorial videos are more succinct and informative and give us a great starting point. I wish we get to see your videos on this topic.
brilliant tutorial series Greg, thanks so much for putting this together and making it fun to learn R Studio
Thank you for the feedback. Glad you enjoyed it!
thanks for your help
Cool video. wow!
Thank you! You made R programming so easy to understand!
Your videos are great!!! Thank you so much for teaching R!
Excellente~! Thanks -
I´m from Brazil and i learn a lot with you! Thanks for the classes!
Glad to hear that! Thank you for the feedback.
Thank you for making such wonderful videos. Very Informative
Glad you like them! My pleasure!
Really helpful content, thank you so much,.
Glad it was helpful!
Brilliant as usual. Go on👍
Best best best best!!! Thank you so much!
Excellent
Thank you! Cheers!
Thank you mate. Learnt a lot 😀
Your videos are so amazing, informative and easy to understand that my professor from University of Leeds is recommending to see videos from this channel. The only thing I believe might be helpful is that you're speaking quite fastly and to understand properly whatever is being said I have to slow the video speed. There might be people who don't know about doing that. Cheers boss!
Thanks. And everything is super duper easy. 😃
haha - happy to hear it.
loved and enjoyed every single second ....
I am always looking for a credible source to learn skills from, and your videos completely fit the bill Sir!
Thank you for engaging with my content and being part of the community. I appreciate your support.
I love this guy! He has helped me so much
Happy to help! Thank you for the feedback.
Thank you for the video
Thanks for watching!
Wonderful Tutorials. Be Blessed as I am making significant progress to earn a data science certification. Your vids are an integral part of my journey. Cheers
Wow Raphael - what a nice thing to say (thanks!!) Glad you like them!
Like first and then watch!
Because you know it's high quality :)
You vedios are Lovely and amazing sir
Taking notes every time. Great content!
Awesome! Thank you!
Great job! Thank you!
Glad it was helpful! Thank you too for watching!
Teaching myself R after grad school to prepare for a job and I am almost angry that it is so much easier than SAS?? Why did I spend so many hours agonizing over SAS when this existed. Thank you so much your videos are extraordinarily informative
I feel your pain. I am a SAS statistical programmer who started with SAS in 1983. So now, 40 years later and retired, I still use SAS. But I started with R a few weeks ago. And I love it!
For yours truly, at least I can reconcile that neither R nor Python existed back in 1983. 😉
There are plenty of jobs that mention R and SAS, so knowing both will be a definite feather in your cap.
Excellent!!
thanks
Great videos. Thank you
One more thing... Please explain why you prefer to work with a long format rather than wide.
Thanks!
Thanks for your great R programing tutorial, your tutorial helps me to understand more in deep understanding of the R programming, just bit currious for the pivot_longer() first arg for the column names from 2:13 range are the actual years from 1952-2007 from a wide_data data frame that you create before, which we change it to name_of_year = "year" in the secound arg of the pivot_longer() am i right.
Please keep making videos for intermediate and advanced R coding level. I already feel my skills were upgraded because of this series of videos that you made for data analysis. Keep it up! Subscribed :)
Thank you for the suggestion. Glad you enjoyed it!
Great video!! Supper helpful. I have already learned a lot from you. But could you please make a video on manipulating dates? For example, If you have a data frame with a date variable column with rows in the form day/month/year, how can you obtain year, month, epidemiological week, day of the month, and day of the week from the date?
4:10, for the rename part, why the "conservation" won't change to "conser" when typing the "View()"? I know for typing "glimpse()" the "conservation" did change to "conser".
I'm having the same issue!
you are amazing
I hope you are going to make more videos. They are easy to understand, important and life saving:))
Glad it was helpful! Thank you :) For sure - More to come!
Thanks Greg. I sadly cannot find the 'gapminder' dataset, neither can I install a package with that name.
Great video. Can't thank you enough.
Glad you enjoyed it!
Perfect video, watched 2023.11.10
love this one! I need to do this presentation that contains some long tables; the choice for presentation is Xaringan, is there a way to make the table spread across slides?
say u use the iris data set and want to do some summary introduction a few words and inline code and then start the table to continue across slides until it is fully loaded in the presentation.
I hope you can help out as this is an important one and currently I do a lot of manual work. Thank you in advance mate.
Could you please make a video on using t-test, chi-square test, ANOVA and regression, please?
Would be so much appreciated !..
Did you ever make the visualise and analyse videos for this series? This has been very helpful in my journey in learning R. Keep being awesome !
Thank you. Thank you, Thank you. Awesome stuff!
You're very welcome!
Good Quality!
I have been following this series keenly and i must say your videos are easy to follow through and understand. Quick question however, I am unable to download the pivot_wider & pivot_longer packages even after updating & loading the tidyverse package. What would you recommend I do? Thanks in advance!
Awesome tutorial 🤘🏻
Shift-Control-M is a lifesaver! I love your videos but I wish you had given the trick earlier
Hi, you are of great help to me. Do you have videos on extreme gradient boosting and comparison to logistic regression?
I'm really enjoying the videos on this youtube channel. Congratulations!
I redid (the pivot_longer) with invented data for exercises and it worked, but I had a problem when it was a little more complex. For example, if I want to organize a table, where there are paired columns. How can do I do it?
I would like to create 3 columns (not 2 as this video), like "Hospital", "condition" and "values".
If I do it 2 times (pivot_longer), the resulting values are repeated in the table
Thank you anyway
Thank you so much for all your work, this channel is super helpful! The main difficulty I have is finding some of the information again when rewatching videos - would it be possible for you to timestamp sections of the videos for easier searching?
So nice of you - thanks for the great feedback -
Much appreciated !!
Great tutorials thank you, I'm learning a lot! However I am having a problem with renaming and recoding the variables. The recoding and renaming codes works fine when I run them, however the "glimpse" and "view" functions will not show the renamed and recoded variables (unless I attach them to the end of the codes with pipe operators). How can I get around this so that the renamed and recoded variables are permanent? Hope that makes sense... thanks!
Thank you!
Thank you so much for watching and leaving a comment! I appreciate your support.
Is there an easy way to use "if else" if you want a new variable to be constructed from two variables? Variable 1 is scored 1, 2, 3, 4, 5, and 9. Variable 2 is scored 1100, 1200, 1300, 10000, 9. Variable 3 is 1 if Variable 1 is 2 and Variable 2 is 1300 otherwise Variable 3 is 0. Also 9 is missing for both variables 1 and 2.
Do you share the R codes that you use in these videos? I'd like to download
Hi very useful videos, thank you! How do I create a new variable to tag unique observations with 0 and then duplicated observations with 1, 2, 3, etc ?
Thank you, bli could pivots wider, but could not pivot longer as it said the function did not recognise an object of class Null. Could you please help me here, thanks Dr. Greg
Update: I created the object long_data before I viewed it and it worked, strange
Thanks a lot for the great videos! Can you please make videos about Shiny packages and how it is used in the medical research!
Great suggestion! Thank you for the feedback. Glad you enjoyed it! 😀
@@RProgramming101 Thank a lot Sir. ))
Wish my prof was as clear as you are
Thank you for the feedback. Glad you enjoyed it!
I tried to run the pivot_longer code but kept getting this error message in console
> long_data %
+ pivot_longer(2:13,
+ names_to = "year",
+ values_to = "lifeExp")
Error in UseMethod("pivot_longer") :
no applicable method for 'pivot_longer' applied to an object of class "NULL"
How can I rename multiple headers at once.
Love your teaching and your work am very grateful it has helped a lot but please next time tell us to set
library(tidyverse)
conflict_prefer(
dplyr:: filter(),
dplyr::lag(),
)
sw %
Felt like pulling teeth, because my filter function refused to work and my output refused to print. when we got to the filter section. dplyr was being masked by r base
at 16:06 can you also arrange by name?
Is it ok to use spread and gather to switch the data format between long and wide?
yes indeed - a lot of people use those functions
How can we add a header (life exp) to the wide data?
Very useful video. The drumming music in the background is very distracting though
Thank you for the feedback :)
'recode' and 'if_else' functions are almost the same right?
Thanks for the easy pissy squessy way you explained everyline
Much appreciated !! Thanks
When I try to perform:
msleep %>% rename("conserv" = "conservation")
I get this error:
Error in rename(., conserv = "conservation") :
Some 'from' names in value not found on 'x': conserv
Does anyone know why this is happening? 🤔
You skipped the part where you install gapfinder. I find that extremely frustrating.
Sorry
@@RProgramming101 No, I should be sorry. I just got introduced to coding and had no idea what I was doing, and I panicked. Seems that the step was very simple. Sorry.
I need a cheat sheet.
hi there - you can get the Cheat Sheet at the end of my Data Visualisation video. Thanks
The music behind you is distractingly bad
Commented with a similar issue that I experienced in the last video in this series.
At 21:55 when going through mutating and recoding, this isn't working for me on the same dataset. Anyone else have the same issue and able to shed any light?
size_of_brain %>%
mutate(brain_size=recode(brain_size,"large"=1,"small"=2))
I have no idea what this means but this is what I get..
Error in `mutate()`:
ℹ In argument: `brain_size = recode(brain_size, large = 1, small = 2)`.
Caused by error in `recode()`:
! unused arguments (large = 1, small = 2)
---
Backtrace:
▆
1. ├─size_of_brain %>% ...
2. ├─dplyr::mutate(., brain_size = recode(brain_size, large = 1, small = 2))
3. └─dplyr:::mutate.data.frame(., brain_size = recode(brain_size, large = 1, small = 2))
4. └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
5. ├─base::withCallingHandlers(...)
6. └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
7. └─mask$eval_all_mutate(quo)
8. └─dplyr (local) eval()
Run rlang::last_trace(drop = FALSE) to see 3 hidden frames.