Video není dostupné.
Omlouváme se.

Manipulate your data. Data wrangling. R programmning for beginners.

Sdílet
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...

Komentáře • 146

  • @RProgramming101
    @RProgramming101  Před rokem +1

    Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library

  • @sofianosss
    @sofianosss Před 3 měsíci +7

    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.

    • @RProgramming101
      @RProgramming101  Před 3 měsíci +2

      Wow, thanks! (that's the best feedback I've ever received) - much apprecaited.

  • @lucasbritodouradocosta1763
    @lucasbritodouradocosta1763 Před 2 lety +28

    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!

  • @yamaahmady1381
    @yamaahmady1381 Před 22 dny

    Thank you so much, Greg. Have never seen such an amazing instructor like you.

    • @RProgramming101
      @RProgramming101  Před 13 dny

      oh wow - that is a very nice compliment. much appreciated.

  • @danquixote6072
    @danquixote6072 Před 2 lety +10

    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.

  • @dhruvil_2662
    @dhruvil_2662 Před 2 lety +7

    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 ❤️

  • @AlexKashie
    @AlexKashie Před 9 měsíci +1

    Another concept made super duper easy... I am stealing this expression from you by the way. Thanks a lot. Really appreciate your content Dr.

  • @max5916
    @max5916 Před 2 lety +4

    Finally you come back we waiting for almost 3 weeks 😻

  • @susanbenson4941
    @susanbenson4941 Před 2 lety +9

    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.

  • @MCshaneization
    @MCshaneization Před 2 lety +2

    Clearest, most succinct R tutorials I've seen on youtube. Great job sir!!

  • @henryirabor6178
    @henryirabor6178 Před 2 lety +1

    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.

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 Před 2 lety +3

    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!

  • @aygeem1764
    @aygeem1764 Před 2 lety +2

    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) :)

  • @EIVlovee21
    @EIVlovee21 Před rokem +1

    Thank you for these tutorials!!!! They are amazing. I wouldn't have been able to finish my thesis without them!!!

  • @zaroilorsaint3531
    @zaroilorsaint3531 Před 2 lety +2

    Thank you, I have learnt so much from this video

  • @douglaspage7311
    @douglaspage7311 Před 2 lety +1

    Awesome! Can't wait for the next installation.

  • @blessingclaudio4777
    @blessingclaudio4777 Před 9 měsíci

    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!

  • @chinuambajekwe5802
    @chinuambajekwe5802 Před 4 měsíci

    Thank you so much for this! Your videos are so detailed and easy to process.

  • @muhammedhadedy4570
    @muhammedhadedy4570 Před 2 lety +1

    Great tutorial as usual. I'm waiting for the analysis series. Thanks so much for your great videos.

  • @sabaiqbal8873
    @sabaiqbal8873 Před rokem

    i just love your videos more than anything else.

  • @navidsolangi
    @navidsolangi Před 2 lety +3

    You are amazing

  • @pipertripp
    @pipertripp Před 2 lety +1

    Great stuff. I enjoy your vids. Always learn something new.

  • @abeergaber6374
    @abeergaber6374 Před 21 dnem

    you are a brilliant teacher thank you very much you make R super fun and easy 🌹🌹🌹🌹🌹🌹🌹🌹

    • @RProgramming101
      @RProgramming101  Před 13 dny

      thanks for the lovely feedback :) Much appreciated. Glad you like the content.

  • @sojibulislam1004
    @sojibulislam1004 Před 2 lety +2

    Great video!! Supper helpful. I have already learned a lot from you

  • @robsonreis76
    @robsonreis76 Před 2 lety +1

    Grrat video. Congrats

  • @romanvasiura6705
    @romanvasiura6705 Před rokem

    "boomshakalaka" 😃))
    Of course, I like it)
    Thank you for this great tutorial lesson. 😉
    These videos are good guideline for me.

  • @addopatrick6042
    @addopatrick6042 Před rokem

    I love Greg's tutorials.

    • @RProgramming101
      @RProgramming101  Před rokem

      I'm glad my videos resonated with you and you found it relatable. Thanks for sharing your experience.

  • @drdigu
    @drdigu Před 2 lety +1

    Very clear presentation. Thanks for this series 😀

  • @MathwithLukgaf
    @MathwithLukgaf Před 2 lety +1

    nice one

  • @bhaskartigp
    @bhaskartigp Před rokem +1

    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.

  • @RodBarkerdigitalmediablog

    brilliant tutorial series Greg, thanks so much for putting this together and making it fun to learn R Studio

  • @benysmart1643
    @benysmart1643 Před 2 lety +1

    thanks for your help

  • @ktmagar7
    @ktmagar7 Před 2 lety +1

    Cool video. wow!

  • @AliceChin75
    @AliceChin75 Před rokem

    Thank you! You made R programming so easy to understand!

  • @annapiddubna3747
    @annapiddubna3747 Před 6 měsíci

    Your videos are great!!! Thank you so much for teaching R!

  • @user-pu9ll7vd5m
    @user-pu9ll7vd5m Před 4 měsíci

    Excellente~! Thanks -

  • @VictorSantos-xq8ku
    @VictorSantos-xq8ku Před 2 lety

    I´m from Brazil and i learn a lot with you! Thanks for the classes!

  • @salmanahmed4213
    @salmanahmed4213 Před 2 lety +1

    Thank you for making such wonderful videos. Very Informative

  • @ravin5756
    @ravin5756 Před 2 lety

    Really helpful content, thank you so much,.

  • @alexlev4631
    @alexlev4631 Před 2 lety +1

    Brilliant as usual. Go on👍

  • @safalbhandari
    @safalbhandari Před rokem

    Best best best best!!! Thank you so much!

  • @rafiqulislam1085
    @rafiqulislam1085 Před rokem

    Excellent

  • @kasundp88
    @kasundp88 Před 2 lety +1

    Thank you mate. Learnt a lot 😀

  • @MuhammadMutasimBillahKhan

    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!

  • @MM_Pishi
    @MM_Pishi Před 14 dny

    Thanks. And everything is super duper easy. 😃

  • @altareq24953
    @altareq24953 Před 9 měsíci

    loved and enjoyed every single second ....

  • @user-db2gu5wi4p
    @user-db2gu5wi4p Před rokem

    I am always looking for a credible source to learn skills from, and your videos completely fit the bill Sir!

    • @RProgramming101
      @RProgramming101  Před rokem

      Thank you for engaging with my content and being part of the community. I appreciate your support.

  • @ajascott3155
    @ajascott3155 Před rokem

    I love this guy! He has helped me so much

  • @bridgettsmith7206
    @bridgettsmith7206 Před 2 lety

    Thank you for the video

  • @raphaeltheanalyst
    @raphaeltheanalyst Před rokem

    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

    • @RProgramming101
      @RProgramming101  Před rokem

      Wow Raphael - what a nice thing to say (thanks!!) Glad you like them!

  • @user-il4rb3fu5m
    @user-il4rb3fu5m Před 9 měsíci

    Like first and then watch!
    Because you know it's high quality :)

  • @krishnavamsi3079
    @krishnavamsi3079 Před 2 lety

    You vedios are Lovely and amazing sir

  • @curiousindividual634
    @curiousindividual634 Před rokem

    Taking notes every time. Great content!

  • @sueyun375
    @sueyun375 Před rokem

    Great job! Thank you!

  • @alpacalad7492
    @alpacalad7492 Před rokem

    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

    • @Zane_Zaminsky
      @Zane_Zaminsky Před 9 měsíci +1

      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.

  • @melinaguillon2449
    @melinaguillon2449 Před 2 měsíci

    Excellent!!

  • @patrickrankin184
    @patrickrankin184 Před rokem

    Great videos. Thank you

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 Před 2 lety +1

    One more thing... Please explain why you prefer to work with a long format rather than wide.
    Thanks!

  • @SamadAli-rf1un
    @SamadAli-rf1un Před 2 lety +1

    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.

  • @blackV199
    @blackV199 Před rokem

    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 :)

  • @moisengwa9904
    @moisengwa9904 Před 2 lety +2

    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?

  • @wenchangyang6497
    @wenchangyang6497 Před 2 lety +1

    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".

  • @upomarahman6654
    @upomarahman6654 Před 2 lety +1

    you are amazing

  • @nahidrasouli7497
    @nahidrasouli7497 Před 2 lety

    I hope you are going to make more videos. They are easy to understand, important and life saving:))

    • @RProgramming101
      @RProgramming101  Před 2 lety

      Glad it was helpful! Thank you :) For sure - More to come!

  • @edgarsmeets7519
    @edgarsmeets7519 Před rokem +1

    Thanks Greg. I sadly cannot find the 'gapminder' dataset, neither can I install a package with that name.

  • @data_kom
    @data_kom Před 2 lety +1

    Great video. Can't thank you enough.

  • @user-zj7cr2pg7c
    @user-zj7cr2pg7c Před 9 měsíci

    Perfect video, watched 2023.11.10

  • @ahmed007Jaber
    @ahmed007Jaber Před 2 lety +1

    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.

  • @faithgoldenears8858
    @faithgoldenears8858 Před 2 lety +1

    Could you please make a video on using t-test, chi-square test, ANOVA and regression, please?
    Would be so much appreciated !..

  • @jiggyfeets6050
    @jiggyfeets6050 Před rokem

    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 !

  • @affyy04
    @affyy04 Před 2 lety

    Thank you. Thank you, Thank you. Awesome stuff!

  • @rondamon4408
    @rondamon4408 Před 8 měsíci

    Good Quality!

  • @cynthiawamzie3174
    @cynthiawamzie3174 Před měsícem

    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!

  • @daniellobo2921
    @daniellobo2921 Před 2 lety

    Awesome tutorial 🤘🏻

  • @yigilantis
    @yigilantis Před 2 lety

    Shift-Control-M is a lifesaver! I love your videos but I wish you had given the trick earlier

  • @ms.lonely9192
    @ms.lonely9192 Před rokem

    Hi, you are of great help to me. Do you have videos on extreme gradient boosting and comparison to logistic regression?

  • @carlosaugustocorrea3998

    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

  • @rahwanetsanet
    @rahwanetsanet Před rokem

    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?

    • @RProgramming101
      @RProgramming101  Před rokem

      So nice of you - thanks for the great feedback -
      Much appreciated !!

  • @estelleghost
    @estelleghost Před rokem

    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!

  • @andrewjohnson4352
    @andrewjohnson4352 Před rokem

    Thank you!

    • @RProgramming101
      @RProgramming101  Před rokem

      Thank you so much for watching and leaving a comment! I appreciate your support.

  • @bradlockerbie
    @bradlockerbie Před 11 měsíci

    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.

  • @victoromballa5043
    @victoromballa5043 Před rokem

    Do you share the R codes that you use in these videos? I'd like to download

  • @foxygrass
    @foxygrass Před 2 lety

    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 ?

  • @S24W2
    @S24W2 Před rokem

    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

    • @S24W2
      @S24W2 Před rokem

      Update: I created the object long_data before I viewed it and it worked, strange

  • @davidispiryan5689
    @davidispiryan5689 Před rokem

    Thanks a lot for the great videos! Can you please make videos about Shiny packages and how it is used in the medical research!

  • @lsacy8347
    @lsacy8347 Před 2 lety

    Wish my prof was as clear as you are

  • @damolaolayinka8477
    @damolaolayinka8477 Před rokem

    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"

  • @emmanuelonuoha3642
    @emmanuelonuoha3642 Před rokem

    How can I rename multiple headers at once.

  • @starstudded9179
    @starstudded9179 Před rokem

    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

  • @Badger5893
    @Badger5893 Před 2 měsíci

    at 16:06 can you also arrange by name?

  • @patrickbigbigx5312
    @patrickbigbigx5312 Před 2 lety

    Is it ok to use spread and gather to switch the data format between long and wide?

  • @jackymo820
    @jackymo820 Před 2 lety

    How can we add a header (life exp) to the wide data?

  • @tessasmith9124
    @tessasmith9124 Před rokem

    Very useful video. The drumming music in the background is very distracting though

  • @ricktikra9579
    @ricktikra9579 Před rokem

    'recode' and 'if_else' functions are almost the same right?

  • @IskledAdebayo-cw8ev
    @IskledAdebayo-cw8ev Před rokem

    Thanks for the easy pissy squessy way you explained everyline

  • @blackmatti86
    @blackmatti86 Před 2 lety

    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? 🤔

  • @kiernanpark-egan2528
    @kiernanpark-egan2528 Před rokem

    You skipped the part where you install gapfinder. I find that extremely frustrating.

    • @RProgramming101
      @RProgramming101  Před rokem +1

      Sorry

    • @kiernanpark-egan2528
      @kiernanpark-egan2528 Před rokem

      @@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.

  • @millsfamily777
    @millsfamily777 Před rokem

    I need a cheat sheet.

    • @RProgramming101
      @RProgramming101  Před rokem

      hi there - you can get the Cheat Sheet at the end of my Data Visualisation video. Thanks

  • @benjorrmin
    @benjorrmin Před rokem

    The music behind you is distractingly bad

  • @krazitired
    @krazitired Před 7 měsíci

    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.