How to draw a line graph using ggplot with R programming. Plots and graphs to visualize data.

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • If you want to use R programming to create plots and graphs using the ggplot package, then watch this video. In this video, I'll go though how to visualize two numeric variables and one categoric variable using line graphs and faceting with ggplot2 (which is a part of the tidyverse set of packages). This is an R programming for beginners video. Good data visualisation and descriptive statistics is the first step in data analysis. If you want to learn statistics and quantitative analysis, then this is a great place to start.

КОМЕНТАРІ • 63

  • @RProgramming101
    @RProgramming101  Рік тому +1

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

  • @matosleni
    @matosleni 3 роки тому +7

    Thanks for the tutorial and simple explanation!
    After a quick review about the types of variables and graphs, the main topic starts at 05:51

  • @nastaranmarzban1419
    @nastaranmarzban1419 3 місяці тому

    Hi, Dr Greg. So far, I've watched 5 videos about ggplot. I wanna confess that they are amazing and am sure that I'll watch all of the rest soon. Thanks for your nice explanation. Honestly, I lose track of time while watching your videos.

  • @adriandevries8716
    @adriandevries8716 Рік тому

    This channel is such a gold mine. God Bless You. This language is haRd.

  • @zhenhuahuang291
    @zhenhuahuang291 3 роки тому +10

    Could you keep adding more videos on linear regression, logistic regression, neural networks, deep learning, etc.?

  • @belindalow5804
    @belindalow5804 3 роки тому +5

    You have been a god send ! I just wasn't getting it until you explained it! And thanks for the reminder not to drugs - made me laugh ! YOU ARE APPRECIATED !

    • @RProgramming101
      @RProgramming101  3 роки тому +1

      Thanks so much for the lovely comment Belinda!!!

  • @mathsheaven1605
    @mathsheaven1605 Рік тому

    Thanks sir , day after tomorrow,i have my exam ,but i even don't know,what my teacher taught me ,she made this easy subject into a heap of trouble, but now after watching ur video , I'll give my best in exam , thank you sir

    • @RProgramming101
      @RProgramming101  Рік тому

      So nice of you to say - thanks for the great feedback and all the best on your exams! You got this!

  • @samuelperren485
    @samuelperren485 2 роки тому +1

    This guy is great! He actually makes me excited about learning R. Thanks Greg, you're a legend 👍

    • @RProgramming101
      @RProgramming101  2 роки тому

      That's kind of you to say :) thanks for the great feedback Samuel!!

  • @forever.student
    @forever.student 2 роки тому +5

    Could you give the R codes for each tutorial in description box? That would tremendously help us in practicing R for new learner like us

  • @shubhankartiwari876
    @shubhankartiwari876 3 роки тому +1

    I like the way you guide us about R programming. It is fun learning with you. request you to add more videos related to R programming so that we can enhance our skillset in it and become Pro like you :)

    • @gregmartin
      @gregmartin 3 роки тому

      Thank you, Shubhankar. Will definitely do.

  • @mibo747
    @mibo747 3 роки тому +1

    many thanks for PERFECT presentation and knowledge

    • @gregmartin
      @gregmartin 3 роки тому

      Thank you for your feedback, Mike. Glad you liked it! 👍

  • @Rehan1824
    @Rehan1824 3 роки тому

    Unblieveable...too much easy to digest coding...like on finger tips...thank you so much

  • @negusuworku2375
    @negusuworku2375 4 місяці тому

    Excellent...very helpful. I have one mor question ...on converting date into Week. Can you please send a video on this matter. Thank you in advance

  • @bestzohan
    @bestzohan 3 роки тому +4

    as always, super didactic! Please keep doing these videos! :D

  • @GiovanniGirelli1104
    @GiovanniGirelli1104 3 роки тому

    I just discovered your channel while looking for information on how to write R code for Power BI. I immediately subscribed and hit that bell button :) Awesome videos. Keep it up.

    • @gregmartin
      @gregmartin 3 роки тому

      Thank you for your feedback, Giovanni. Much appreciated 👍

  • @설아뚜아
    @설아뚜아 2 роки тому +1

    Thanks for the tutorial and simple explanation!

  • @veroniquemigue7985
    @veroniquemigue7985 3 роки тому +1

    Thank you for another helpful video. Keep em coming!

  • @dcruz8510
    @dcruz8510 3 роки тому +1

    Great easy explanations and great tips

  • @amada.10
    @amada.10 3 роки тому

    Can you please put on your video description, a link to the database you were referred to create this video,it will help us a lot , Thank you🙂

  • @noureddineabid1753
    @noureddineabid1753 11 місяців тому

    It is very useful. Thank you

  • @gedagelana512
    @gedagelana512 3 роки тому +1

    Greetings Mr. Martin! Thank you for your great channel. I'm learning so much from you. In the last two minutes of the above video, you discuss filtering a data set for a few variables and then consolidating them onto one graph for better comparison. I'm trying the same thing but getting a blank graph. My code shows no errors. Why is that? ...when I run it after filtering just one variable, it displays a graph. But when I filter two variables from the df and pipe it to ggplot, it becomes blank. I would appreciate your help! Many thanks!

  • @waqarabbas1722
    @waqarabbas1722 Рік тому

    Sir I mess up in understanding under what case type to plot different type of graphs for example when to create scatter plot or when do we plot line graph. This problem implies to all types of graphs I can't understand which graph to choose . Can you give an explanation on regarding the use of different types of graphs?

  • @ahmed007Jaber
    @ahmed007Jaber 2 роки тому

    thank u for this. suppose you got quantity of items sold and the value of the sale
    you want to should bars for sale value and line for quantity how would you do that???

  •  3 роки тому

    I really like your work, Greg! Thanks so much

    • @gregmartin
      @gregmartin 3 роки тому

      Glad you liked it, Francisco! Thank you!

  • @romanvasiura6705
    @romanvasiura6705 Рік тому

    Thank you for this amazing video.

  • @ktcoding7
    @ktcoding7 3 роки тому +3

    You make it so cool. :)

  • @jamesleleji6984
    @jamesleleji6984 Рік тому

    Why did you not use the color argument in the geom_line function?

  • @arifmemovic3383
    @arifmemovic3383 Рік тому

    Did you program the drum and bass breakbeat at the beginning of the video?

  • @mychudungco
    @mychudungco 2 роки тому

    Thanks for the video, but next time, please explain each code line in detail so that learner can follow. In this video, you passed lots of code lines, for example, from 80-83, so that it is hard to follow for new learners like me

    • @RProgramming101
      @RProgramming101  2 роки тому

      Sorry about that, Thanks for the suggestion and for watching :)

  • @bernardraath7390
    @bernardraath7390 3 роки тому

    Hi you sound South African. Also. Please can you do one with loads of data as with spectra. I have to do it for my project and can't for the life of me figure it out. If you can reach out please.

  • @yw1182
    @yw1182 2 роки тому

    Thank you ! great vid.

    • @RProgramming101
      @RProgramming101  2 роки тому

      Glad you liked it! Thank you for the feedback.

  • @herbertchitere4142
    @herbertchitere4142 3 роки тому +1

    Thanks Greg

  • @salmaasghar9099
    @salmaasghar9099 2 роки тому

    Hello my R studio doesnot have a function data but data.class and other options appear here. What should i do?

  • @pawelkurtyka9672
    @pawelkurtyka9672 3 роки тому

    WOW! Greg! Thanks so much

    • @gregmartin
      @gregmartin 3 роки тому

      You're very much welcome, Pawel!

  • @programmingwithjackchew903
    @programmingwithjackchew903 2 роки тому

    great video

  • @johirislam8174
    @johirislam8174 3 роки тому

    I created a volcano plot by enhance volcano.But in the plot instead of showing the gene symbol some kind of number are shown.So how can i solve this problem.
    EnhancedVolcano(exp1, x = "logFC", y = "adj.P.Val",
    lab = rownames(exp1),
    FCcutoff = 0.6, pCutoff=0.01, cutoffLineType = 'twodash',
    cutoffLineWidth = 0.4, pointSize = 1, legendPosition = 'none',
    title = "", subtitle = "", caption = "", labSize = 3, ylim = c(0, 6)) +
    theme_pubr(legend = "none").
    exp1 is my dataset and the first column of that dataset is gene symbol.

  • @atifdai313
    @atifdai313 Рік тому

    How can we make line graph of 30 countries...........I am using panel data.

  • @Alonso_Cid
    @Alonso_Cid 2 роки тому

    Do anyone knows if I can make a plot with 2 different geometries each representing different data?

  • @edongoogle8290
    @edongoogle8290 3 роки тому

    I get this back in my console for 11.26
    > Orange %>%
    + filter(Tree != "2") %>%
    + ggplot(aes(age,circumference))+
    + geom_point()+
    + geom_smooth()+
    + facet_wrap(~Tree)+
    + theme_bw()
    `geom_smooth()` using method = 'loess' and formula 'y ~ x'
    > facet_wrap()+
    + labs(Title="Tree Age and Circumference")
    Error in wrap_as_facets_list(facets) :
    argument "facets" is missing, with no default
    > Orange %>%
    + filter(Tree != "2") %>%
    + ggplot(aes(age,circumference))+
    + geom_point()+
    + geom_smooth()+
    + facet_wrap(~Tree)+
    + theme_bw()
    `geom_smooth()` using method = 'loess' and formula 'y ~ x'
    > facet_wrap()+
    + labs(title="Tree Age and Circumference")
    Error in wrap_as_facets_list(facets) :
    argument "facets" is missing, with no default
    > Orange %>%
    + filter(Tree != "1" &
    + Tree !+ "2") %>%
    Error: unexpected '!' in:
    " filter(Tree != "1" &
    Tree !"
    > ggplot(aes(age, circumference, colour, Tree))+
    + geom_point(size = 5, alpha = 0.3)+
    + geom_line(size =1)+
    + theme_minimal()+
    + labs(title = "Tree age and circumference")
    Error: `data` must be a data frame, or other object coercible by `fortify()`, not an S3 object with class uneval
    Did you accidentally pass `aes()` to the `data` argument?
    Run `rlang::last_error()` to see where the error occurred.
    In addition: Warning message:
    Duplicated aesthetics after name standardisation:
    >

  • @tuhinsuryachakraborty
    @tuhinsuryachakraborty 4 місяці тому

  • @analyticsvisionary8197
    @analyticsvisionary8197 3 роки тому

    AAA content!

    • @gregmartin
      @gregmartin 3 роки тому

      Thank you for the feedback 👍

  • @georgebiffen2554
    @georgebiffen2554 Рік тому

    dartar 😂

  • @paulhetherington3854
    @paulhetherington3854 Рік тому

    Cat