If you want to download the R-code to this video you can do this here in my free skool community: www.skool.com/data-analysis-with-r-6607/classroom/daa88316?md=e32411294ee7464d90d07527746fb9dc
Hi Tara, thank you for leaving such a nice and encouraging comment. I am planning many more uploads and hopefully get to some in the next weeks. Until then :)
You are doing great service. I am loving your videos. Kindly keep uploading more videos on R. Also, create a video to show multivariates in single graph.
Thank you for this encouraging comment. I keep track of all the requests and suggestions and will hopefully be able to fulfill some wishes of my subscribers. Luckily I am interested in a wide range of R-related topics so there will be videos covering many things in the future.
Thanks and I agree. It is a quick way to look for relationships between the variables. Some of the functions are quite powerful in doing hierarchical clustering already.
Great video! How do you reverse/flip the color scale in the corrplot package? I prefer to have negative correlation blue and positive correlations red. Sort of a temperature/ cold-and-hot mentality. Thanks!
Alright man :D If you want to discuss data analysis or R specific problems you could join my free community on skool (www.skool.com/data-analysis-with-r-6607/about). You would be one of the early members to join.
Hello! thanks for you video, may i ask for a little help... when i call the function ggcorr the console print Error in ggcorr, could not found the function "ggcorr"
Hi Renan, yes it is. The help function and examples are actually quite good for this function. Try: ?corrplot() or help(corrplot) and then scroll down to this section: It shows you many examples that you can customize on how to adding p-values and stars etc. data(mtcars) M = cor(mtcars) ##the input matrix is not square testRes = cor.mtest(mtcars, conf.level = 0.95) ## specialized the insignificant value according to the significant level corrplot(M, p.mat = testRes$p, sig.level = 0.05, order = 'hclust', addrect = 2) ## leave blank on no significant coefficient corrplot(M, p.mat = testRes$p, method = 'circle', type = 'lower', insig ='blank', addCoef.col ='black', number.cex = 0.8, order = 'AOE', diag = FALSE) ## add p-values on no significant coefficients corrplot(M, p.mat = testRes$p, insig = 'p-value') ## add all p-values corrplot(M, p.mat = testRes$p, insig = 'p-value', sig.level = -1) ## add significant level stars corrplot(M, p.mat = testRes$p, method = 'color', diag = FALSE, type = 'upper', sig.level = c(0.001, 0.01, 0.05), pch.cex = 0.9, insig = 'label_sig', pch.col = 'grey20', order = 'AOE')
In the following code, how can I change the default color? I have tried using color brewer palette where only histograms colors are being changed but scatterplot color remain unchanged. How can I change default color for everything including labels & scatterplots? GGally::ggpairs(iris, columns = 1:4, ggplot2::aes(colour=species))
Hello, it's a nice video, can you please tell us how to plot few variables correlation species, actually i got the plot but that is mixed, among variables. I want few variables on one side and species another side. Is it possible? if yes, then kindly suggests us some information about it. Thank you.
Hi Muhammad Farooq, unfortunately I don't understand the question completely. Can you give me a time stamp to where in the video your question relates to? If you mean species from the iris dataset then this does not really have a correlation to variables, as it is a category with only 3 levels. However I post code below to show you how to only show correlation between a few selected variables (maybe that is what you asked about): corr_matrix
@@scenarios911 Glad it worked and was what you were looking for. I think I should have included such in example in the video as another subscriber emailed me with a similar request. Anyway, thanks for leaving such a polite comment and letting me know my answer helped. It is always very rewarding to see the extra effort being useful to my subscribers.
thanks for this video. I have a problem whith #adding species information and color#, this step didn't work for me when I executeö GGally::ggpairs(iris, columns = 1:4, ggplot2::aes(colour=species)) this message appears: plot: [1,1] [==>-----------------------------------------------] 6% est: 0s Error in FUN(X[[i]], ...) : object 'species' not found Can you help me please
Of course I can help you. When I copy your code I get the same error. Unfortunately you made a tiny mistake that is usually really hard to find. The error message tells you that it cannot find "species" in the iris data. Because in iris it is written with a capital-S. When you change species to Species it runs fine. Don't be discourage, these typos happen very often.
Can you make a video on Flexdashboard and how to add filters to the dashboard to create full interactivity? For instance, I filter on a specific item then the whole dashboard will be reflected on it.
More interactive graphs, dashboards and shinyApps are definitely on my list of topics I want to cover. I am not sure when I will get there but I keep track of your request and thank you for the comment.
@@TheDataDigest Yes, please. Flexdashboard is also really awesome if you can make a video on it as well and applying filter on the dashboard as I mentioned before. That would be awesome. But please tech us in an easy way like to use your Dashboard as a template just changing the data source. Thanks in advance, much appreciated 👏👏👏
@@findthetruth3021 I will definitely create something on that topic this year :) Maybe here is already something that fits your needs: pkgs.rstudio.com/flexdashboard/articles/examples.html In the top right corner you get the source code an can try to adjust it accordingly.
Excellent request Rashid and quite a coincidence because another guy just asked about options to save images as png file. My next video is already planned and will be published soon, but after that I will make a video on how to save charts as png or pdf. What you can do for now is simply create your chart and in RStudio select the Export option in your Plots panel. Save as PDF should be an option to chose. Use the preview button to check whether the height and width looks good and save as file.
Hi, I recommend looking into the patchwork package. In this video I combined many charts into one plot (ua-cam.com/video/FzntrJ8l5as/v-deo.html). Also in the 30DayChartChallenge (twitter.com/DigestData) you find many examples of multiple charts in one plot.
Hi, do you need the R-code from the video or do you have a specific request to help with your data? You can send questions directly to: question[at]thedatadigest[dot]email
@@TheDataDigest thanks for your response, yes I want code for corep analysis and drawing the figures in R software, can i put my question to the email address that you sent?
@@meliheser01 I suggest looking into geom_point() for scatterplots [ua-cam.com/video/sk59wjdmrd8/v-deo.html], you can also add geom_smooth(method='lm', formula= y~x))
I thank you very much for this very rich tutorial, but when I tried to apply it to my data I receive this message which I do not understand because I am still a beginner if you can help me and thank you once again: GGally::ggpairs(log,columns = 1:13,ggplot2::aes(colours=Season)) plot: [1,2] [=>---------------------------------------- -------------------------------------------------- -------------------------------------------------- -] 1% is:14s Error in cor.test.default(x, y, method = method, use = use): not enough finite observations
Sorry to hear that, but errors are common and should not discourage you. What I recommend is to post a reproducible example with a small dataset and R-code that produced the error at: www.stackoverflow.com Feel free to post the link here and I can answer on their website.
If you want to download the R-code to this video you can do this here in my free skool community:
www.skool.com/data-analysis-with-r-6607/classroom/daa88316?md=e32411294ee7464d90d07527746fb9dc
Thank you Sir for the excellent explanation, I believe now, I will be able to learn and I have a hope. Please keep upload more videos
Hi Tara, thank you for leaving such a nice and encouraging comment. I am planning many more uploads and hopefully get to some in the next weeks. Until then :)
@0.38 sec, i liked the video and subscribed your channel. very easy to get information
Glad to have you as a subscriber. Sorry I haven't uploaded much lately, but that will change next week :)
You are doing great service. I am loving your videos. Kindly keep uploading more videos on R. Also, create a video to show multivariates in single graph.
Thank you for this encouraging comment. I keep track of all the requests and suggestions and will hopefully be able to fulfill some wishes of my subscribers. Luckily I am interested in a wide range of R-related topics so there will be videos covering many things in the future.
@@TheDataDigest Hello is it possible to give me R code for drawing coreplot?
Very well described
for getting help you can also put the cursor on the function you want to know more about and hit the F1 key.
Thanks for the tip! F1 is usually the help in many programs but I never tried it out in RStudio.
Thanks again for another awesome video!
Big fan in here!
My pleasure :)
I hope I will gather more fans in the future that look forward to weekly new content. But great to hear I have at least one already.
wow this was so helpful and perfect for my needs. Thank you for your effort!
Glad you liked it and left such a nice comment.
@TheDataDigest Please ,Show Correlation of Random Variables at Levels & at first Differences❤
Life saver. Thank you sir..
You are welcome. Let me know if I can help you with anything else. For what data are you using the correlation plots if I may ask?
Great. Thank you very much for sharing this useful tutorial.
Thanks for leaving such a nice comment. Glad it helped :)
This is very useful, I'm sure I'll use this. Thanks!
Thanks and I agree. It is a quick way to look for relationships between the variables. Some of the functions are quite powerful in doing hierarchical clustering already.
This is a great video I just love your videos.Great job
Hi, thanks for the kind comment. Just the encouragement I needed to upload new video after a six week long break.
it was very helpfull.. thank you so much
Superb video
Brilliant detail
Thanks. It is my best performing video so far. Maybe I should make one about ggpairs which is also a good first visualization package.
Absolutely, if it's not too much hassle....they're of great help
Helped a Lot. Thank you.
Glad to hear that and thanks for letting me know in a comment :)
Excellent! Wonderfull explanation! Thank you very much!
excellent overview!
Great video!
How do you reverse/flip the color scale in the corrplot package? I prefer to have negative correlation blue and positive correlations red. Sort of a temperature/ cold-and-hot mentality. Thanks!
bro i love u
Alright man :D If you want to discuss data analysis or R specific problems you could join my free community on skool (www.skool.com/data-analysis-with-r-6607/about). You would be one of the early members to join.
Fantastic! It helped a lot
Great to hear, and thanks for leaving a comment. What data sets are you working on these days? Let me know if you need any help with R programming.
Great, thanx
Hello! thanks for you video, may i ask for a little help... when i call the function ggcorr the console print Error in ggcorr, could not found the function "ggcorr"
The ggcorr function is part of the GGally package. Did you make sure to install and load it first?
install.packages("GGally"); library(GGally)
this was amazing! thank you
Great! This video is really helpful. Is possible include *** for the significance level in corrplot package?
Hi Renan, yes it is. The help function and examples are actually quite good for this function.
Try: ?corrplot() or help(corrplot) and then scroll down to this section:
It shows you many examples that you can customize on how to adding p-values and stars etc.
data(mtcars)
M = cor(mtcars)
##the input matrix is not square
testRes = cor.mtest(mtcars, conf.level = 0.95)
## specialized the insignificant value according to the significant level
corrplot(M, p.mat = testRes$p, sig.level = 0.05, order = 'hclust', addrect = 2)
## leave blank on no significant coefficient
corrplot(M, p.mat = testRes$p, method = 'circle', type = 'lower', insig ='blank',
addCoef.col ='black', number.cex = 0.8, order = 'AOE', diag = FALSE)
## add p-values on no significant coefficients
corrplot(M, p.mat = testRes$p, insig = 'p-value')
## add all p-values
corrplot(M, p.mat = testRes$p, insig = 'p-value', sig.level = -1)
## add significant level stars
corrplot(M, p.mat = testRes$p, method = 'color', diag = FALSE, type = 'upper',
sig.level = c(0.001, 0.01, 0.05), pch.cex = 0.9,
insig = 'label_sig', pch.col = 'grey20', order = 'AOE')
@@TheDataDigest Lot of thanks!
Wow tx sir
No problem. I am glad you watch my videos.
In the following code, how can I change the default color? I have tried using color brewer palette where only histograms colors are being changed but scatterplot color remain unchanged. How can I change default color for everything including labels & scatterplots?
GGally::ggpairs(iris, columns = 1:4,
ggplot2::aes(colour=species))
Hello, it's a nice video, can you please tell us how to plot few variables correlation species, actually i got the plot but that is mixed, among variables. I want few variables on one side and species another side. Is it possible? if yes, then kindly suggests us some information about it. Thank you.
Hi Muhammad Farooq, unfortunately I don't understand the question completely.
Can you give me a time stamp to where in the video your question relates to?
If you mean species from the iris dataset then this does not really have a correlation to variables, as it is a category with only 3 levels.
However I post code below to show you how to only show correlation between a few selected variables (maybe that is what you asked about):
corr_matrix
@@TheDataDigest Wow, that's worked sir, i am really grateful to you, thanks once again. Hats off to you..
@@scenarios911 Glad it worked and was what you were looking for. I think I should have included such in example in the video as another subscriber emailed me with a similar request.
Anyway, thanks for leaving such a polite comment and letting me know my answer helped. It is always very rewarding to see the extra effort being useful to my subscribers.
thanks for this video. I have a problem whith #adding species information and color#, this step didn't work for me when I executeö
GGally::ggpairs(iris, columns = 1:4,
ggplot2::aes(colour=species))
this message appears:
plot: [1,1] [==>-----------------------------------------------] 6% est: 0s Error in FUN(X[[i]], ...) : object 'species' not found
Can you help me please
Of course I can help you. When I copy your code I get the same error. Unfortunately you made a tiny mistake that is usually really hard to find. The error message tells you that it cannot find "species" in the iris data. Because in iris it is written with a capital-S. When you change species to Species it runs fine. Don't be discourage, these typos happen very often.
@@TheDataDigest thanks a lot for your help
can you give me how to interpret this diagram (iris)
Can you make a video on Flexdashboard and how to add filters to the dashboard to create full interactivity? For instance, I filter on a specific item then the whole dashboard will be reflected on it.
More interactive graphs, dashboards and shinyApps are definitely on my list of topics I want to cover. I am not sure when I will get there but I keep track of your request and thank you for the comment.
@@TheDataDigest Yes, please. Flexdashboard is also really awesome if you can make a video on it as well and applying filter on the dashboard as I mentioned before. That would be awesome. But please tech us in an easy way like to use your Dashboard as a template just changing the data source. Thanks in advance, much appreciated 👏👏👏
@@findthetruth3021 I will definitely create something on that topic this year :) Maybe here is already something that fits your needs: pkgs.rstudio.com/flexdashboard/articles/examples.html
In the top right corner you get the source code an can try to adjust it accordingly.
could you please make a video on how to save output results in PDF file.
Excellent request Rashid and quite a coincidence because another guy just asked about options to save images as png file. My next video is already planned and will be published soon, but after that I will make a video on how to save charts as png or pdf.
What you can do for now is simply create your chart and in RStudio select the Export option in your Plots panel. Save as PDF should be an option to chose. Use the preview button to check whether the height and width looks good and save as file.
@@TheDataDigest Thank you for your Response. Actually , i want to know how to save output results in PDF.
Hi, can we plot summary statistics and correlation plot in single diagram.? thanx
Hi, I recommend looking into the patchwork package. In this video I combined many charts into one plot (ua-cam.com/video/FzntrJ8l5as/v-deo.html).
Also in the 30DayChartChallenge (twitter.com/DigestData) you find many examples of multiple charts in one plot.
@@TheDataDigest THANX. I will try.
Hello, can you help me in this soft ware? I want to drag a coreplot
Hi, do you need the R-code from the video or do you have a specific request to help with your data?
You can send questions directly to: question[at]thedatadigest[dot]email
@@TheDataDigest thanks for your response, yes I want code for corep analysis and drawing the figures in R software, can i put my question to the email address that you sent?
If i want to create correlation between two variables. How should I do it?
Try: cor.test(x=data$variable1, y=data$variable2), or did you mean plotting them?
@@TheDataDigest i meant plotting them
@@meliheser01 I suggest looking into geom_point() for scatterplots [ua-cam.com/video/sk59wjdmrd8/v-deo.html], you can also add geom_smooth(method='lm', formula= y~x))
How I apply this script on my data set
Come in my skool community and share the code and script and I can help you out. Or you email me with your specific problem.
I thank you very much for this very rich tutorial, but when I tried to apply it to my data I receive this message which I do not understand because I am still a beginner if you can help me and thank you once again:
GGally::ggpairs(log,columns = 1:13,ggplot2::aes(colours=Season))
plot: [1,2] [=>---------------------------------------- -------------------------------------------------- -------------------------------------------------- -] 1% is:14s Error in cor.test.default(x, y, method = method, use = use):
not enough finite observations
Sorry to hear that, but errors are common and should not discourage you. What I recommend is to post a reproducible example with a small dataset and R-code that produced the error at: www.stackoverflow.com
Feel free to post the link here and I can answer on their website.