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.
Get my FREE cheat sheets for R programming and statistics (including transcripts of these lessons) here: www.learnmore365.com/courses/rprogramming-resource-library
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
Thank you, Leni 🙂
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.
This channel is such a gold mine. God Bless You. This language is haRd.
Could you keep adding more videos on linear regression, logistic regression, neural networks, deep learning, etc.?
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 !
Thanks so much for the lovely comment Belinda!!!
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
So nice of you to say - thanks for the great feedback and all the best on your exams! You got this!
This guy is great! He actually makes me excited about learning R. Thanks Greg, you're a legend 👍
That's kind of you to say :) thanks for the great feedback Samuel!!
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
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 :)
Thank you, Shubhankar. Will definitely do.
many thanks for PERFECT presentation and knowledge
Thank you for your feedback, Mike. Glad you liked it! 👍
Unblieveable...too much easy to digest coding...like on finger tips...thank you so much
You're welcome!
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
as always, super didactic! Please keep doing these videos! :D
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.
Thank you for your feedback, Giovanni. Much appreciated 👍
Thanks for the tutorial and simple explanation!
Glad it was helpful!
Thank you for another helpful video. Keep em coming!
Thanks, will do!
Great easy explanations and great tips
Thanks for the feedback.
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🙂
It is very useful. Thank you
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!
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?
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???
I really like your work, Greg! Thanks so much
Glad you liked it, Francisco! Thank you!
Thank you for this amazing video.
Glad you enjoyed it! Thank you too!
You make it so cool. :)
Thanks.
Why did you not use the color argument in the geom_line function?
Did you program the drum and bass breakbeat at the beginning of the video?
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
Sorry about that, Thanks for the suggestion and for watching :)
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.
Thank you ! great vid.
Glad you liked it! Thank you for the feedback.
Thanks Greg
You are most welcome.
Hello my R studio doesnot have a function data but data.class and other options appear here. What should i do?
WOW! Greg! Thanks so much
You're very much welcome, Pawel!
great video
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.
How can we make line graph of 30 countries...........I am using panel data.
Do anyone knows if I can make a plot with 2 different geometries each representing different data?
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:
>
❤
AAA content!
Thank you for the feedback 👍
dartar 😂
Cat