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

Поделиться
HTML-код
  • Опубликовано: 18 янв 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-knowledge.com/

Комментарии • 140

  • @RProgramming101
    @RProgramming101  11 месяцев назад

    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 2 месяца назад +5

    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  2 месяца назад +1

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

  • @lucasbritodouradocosta1763
    @lucasbritodouradocosta1763 2 года назад +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!

  • @henryirabor6178
    @henryirabor6178 2 года назад +1

    By far the best R tutorial I've seen on RUclips. Man you are truly awesome. Your videos have made me understand R better than anything I've ever seen.

  • @susanbenson4941
    @susanbenson4941 2 года назад +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.

  • @douglaspage7311
    @douglaspage7311 2 года назад +1

    Awesome! Can't wait for the next installation.

  • @AlexKashie
    @AlexKashie 8 месяцев назад +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.

  • @aygeem1764
    @aygeem1764 Год назад +2

    I'm here to sincerely thank you for these tutorials. I didn't know where to start with R. Then I came to RUclips 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) :)

  • @muhammedhadedy4570
    @muhammedhadedy4570 2 года назад +1

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

  • @max5916
    @max5916 2 года назад +4

    Finally you come back we waiting for almost 3 weeks 😻

  • @zaroilorsaint3531
    @zaroilorsaint3531 2 года назад +2

    Thank you, I have learnt so much from this video

  • @AliceChin75
    @AliceChin75 Год назад

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

  • @EIVlovee21
    @EIVlovee21 Год назад +1

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

  • @blessingclaudio4777
    @blessingclaudio4777 8 месяцев назад

    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!

  • @pipertripp
    @pipertripp 2 года назад +1

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

  • @annapiddubna3747
    @annapiddubna3747 5 месяцев назад

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

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 2 года назад +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!

  • @MCshaneization
    @MCshaneization 2 года назад +2

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

  • @sabaiqbal8873
    @sabaiqbal8873 11 месяцев назад

    i just love your videos more than anything else.

  • @dhruvil_2662
    @dhruvil_2662 2 года назад +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 ❤️

  • @chinuambajekwe5802
    @chinuambajekwe5802 3 месяца назад

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

  • @alexlev4631
    @alexlev4631 2 года назад +1

    Brilliant as usual. Go on👍

  • @kasundp88
    @kasundp88 2 года назад +1

    Thank you mate. Learnt a lot 😀

  • @user-il4rb3fu5m
    @user-il4rb3fu5m 8 месяцев назад

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

  • @robsonreis76
    @robsonreis76 2 года назад +1

    Grrat video. Congrats

  • @danquixote6072
    @danquixote6072 2 года назад +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.

  • @safalbhandari
    @safalbhandari Год назад

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

  • @bhaskartigp
    @bhaskartigp Год назад +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 RUclipsrs 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.

  • @ktmagar7
    @ktmagar7 2 года назад +1

    Cool video. wow!

  • @altareq24953
    @altareq24953 8 месяцев назад

    loved and enjoyed every single second ....

  • @patrickrankin184
    @patrickrankin184 Год назад

    Great videos. Thank you

  • @RodBarkerdigitalmediablog
    @RodBarkerdigitalmediablog 2 года назад +1

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

    • @RProgramming101
      @RProgramming101  2 года назад

      Thank you for the feedback. Glad you enjoyed it!

  • @navidsolangi
    @navidsolangi 2 года назад +3

    You are amazing

  • @benysmart1643
    @benysmart1643 2 года назад +1

    thanks for your help

  • @MathwithLukgaf
    @MathwithLukgaf 2 года назад +1

    nice one

  • @VictorSantos-xq8ku
    @VictorSantos-xq8ku Год назад

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

  • @krishnavamsi3079
    @krishnavamsi3079 2 года назад

    You vedios are Lovely and amazing sir

  • @user-pu9ll7vd5m
    @user-pu9ll7vd5m 3 месяца назад

    Excellente~! Thanks -

  • @addopatrick6042
    @addopatrick6042 Год назад

    I love Greg's tutorials.

    • @RProgramming101
      @RProgramming101  Год назад

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

  • @rondamon4408
    @rondamon4408 7 месяцев назад

    Good Quality!

  • @ajascott3155
    @ajascott3155 Год назад

    I love this guy! He has helped me so much

  • @upomarahman6654
    @upomarahman6654 2 года назад +1

    you are amazing

  • @sojibulislam1004
    @sojibulislam1004 2 года назад +2

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

  • @daniellobo2921
    @daniellobo2921 2 года назад

    Awesome tutorial 🤘🏻

  • @affyy04
    @affyy04 2 года назад

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

  • @blackV199
    @blackV199 Год назад

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

    • @RProgramming101
      @RProgramming101  Год назад

      Thank you for the suggestion. Glad you enjoyed it!

  • @MuhammadMutasimBillahKhan
    @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!

  • @drdigu
    @drdigu 2 года назад +1

    Very clear presentation. Thanks for this series 😀

  • @jiggyfeets6050
    @jiggyfeets6050 Год назад

    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 !

  • @moisengwa9904
    @moisengwa9904 2 года назад +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?

  • @sueyun375
    @sueyun375 Год назад

    Great job! Thank you!

    • @RProgramming101
      @RProgramming101  Год назад

      Glad it was helpful! Thank you too for watching!

  • @romanvasiura6705
    @romanvasiura6705 Год назад

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

  • @curiousindividual634
    @curiousindividual634 Год назад

    Taking notes every time. Great content!

  • @raphaeltheanalyst
    @raphaeltheanalyst Год назад

    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  Год назад

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

  • @SamadAli-rf1un
    @SamadAli-rf1un 2 года назад +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.

  • @user-zj7cr2pg7c
    @user-zj7cr2pg7c 8 месяцев назад

    Perfect video, watched 2023.11.10

  • @ahmed007Jaber
    @ahmed007Jaber 2 года назад +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.

  • @ravin5756
    @ravin5756 2 года назад

    Really helpful content, thank you so much,.

  • @salmanahmed4213
    @salmanahmed4213 2 года назад +1

    Thank you for making such wonderful videos. Very Informative

  • @user-db2gu5wi4p
    @user-db2gu5wi4p Год назад

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

    • @RProgramming101
      @RProgramming101  Год назад

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

  • @nahidrasouli7497
    @nahidrasouli7497 2 года назад

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

    • @RProgramming101
      @RProgramming101  2 года назад

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

  • @bridgettsmith7206
    @bridgettsmith7206 Год назад

    Thank you for the video

  • @data_kom
    @data_kom 2 года назад +1

    Great video. Can't thank you enough.

  • @faithgoldenears8858
    @faithgoldenears8858 2 года назад +1

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

  • @melinaguillon2449
    @melinaguillon2449 Месяц назад

    Excellent!!

  • @carlosaugustocorrea3998
    @carlosaugustocorrea3998 2 года назад

    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

  • @andrewjohnson4352
    @andrewjohnson4352 Год назад

    Thank you!

    • @RProgramming101
      @RProgramming101  Год назад

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

  • @haraldurkarlsson1147
    @haraldurkarlsson1147 2 года назад +1

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

  • @ms.lonely9192
    @ms.lonely9192 11 месяцев назад

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

  • @yigilantis
    @yigilantis 2 года назад

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

  • @rafiqulislam1085
    @rafiqulislam1085 Год назад

    Excellent

  • @alpacalad7492
    @alpacalad7492 Год назад

    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 8 месяцев назад +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.

  • @estelleghost
    @estelleghost Год назад

    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!

  • @rahwanetsanet
    @rahwanetsanet Год назад

    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  Год назад

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

  • @cynthiawamzie3174
    @cynthiawamzie3174 5 дней назад

    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!

  • @foxygrass
    @foxygrass 2 года назад

    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 ?

  • @edgarsmeets7519
    @edgarsmeets7519 11 месяцев назад +1

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

  • @davidispiryan5689
    @davidispiryan5689 Год назад

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

    • @RProgramming101
      @RProgramming101  Год назад

      Great suggestion! Thank you for the feedback. Glad you enjoyed it! 😀

    • @davidispiryan5689
      @davidispiryan5689 Год назад

      @@RProgramming101 Thank a lot Sir. ))

  • @wenchangyang6497
    @wenchangyang6497 Год назад +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".

  • @lsacy8347
    @lsacy8347 2 года назад

    Wish my prof was as clear as you are

    • @RProgramming101
      @RProgramming101  2 года назад

      Thank you for the feedback. Glad you enjoyed it!

  • @jackymo820
    @jackymo820 2 года назад

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

  • @S24W2
    @S24W2 Год назад

    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 Год назад

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

  • @victoromballa5043
    @victoromballa5043 Год назад

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

  • @emmanuelonuoha3642
    @emmanuelonuoha3642 Год назад

    How can I rename multiple headers at once.

  • @tessasmith9124
    @tessasmith9124 Год назад

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

  • @damolaolayinka8477
    @damolaolayinka8477 Год назад

    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"

  • @patrickbigbigx5312
    @patrickbigbigx5312 2 года назад

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

    • @RProgramming101
      @RProgramming101  2 года назад +1

      yes indeed - a lot of people use those functions

  • @starstudded9179
    @starstudded9179 Год назад

    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

  • @IskledAdebayo-cw8ev
    @IskledAdebayo-cw8ev Год назад

    Thanks for the easy pissy squessy way you explained everyline

  • @bradlockerbie
    @bradlockerbie 10 месяцев назад

    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.

  • @Badger5893
    @Badger5893 Месяц назад

    at 16:06 can you also arrange by name?

  • @blackmatti86
    @blackmatti86 2 года назад

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

  • @ricktikra9579
    @ricktikra9579 Год назад

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

  • @millsfamily777
    @millsfamily777 Год назад

    I need a cheat sheet.

    • @RProgramming101
      @RProgramming101  Год назад

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

  • @kiernanpark-egan2528
    @kiernanpark-egan2528 Год назад

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

    • @RProgramming101
      @RProgramming101  Год назад +1

      Sorry

    • @kiernanpark-egan2528
      @kiernanpark-egan2528 Год назад

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

  • @benjorrmin
    @benjorrmin Год назад

    The music behind you is distractingly bad

  • @krazitired
    @krazitired 5 месяцев назад

    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.