Analysis in R: Useful for expressing multivariable relationships! The “corrplot” package

RAnalytics
スポンサーリンク

This is an introduction to a package that is useful for expressing multivariable relationships. For basic use, the contents of the exsample command should be sufficient. For other options, see the package help.

This package is recommended because the plot contents can be easily changed at the top and bottom.

In addition, packages that use the ggplot2 package are also presented for your reference. Why not use them according to your preferences?

・Analysis in R: Useful for understanding multivariable relationships! The “ggcorrplot” package
 https://www.karada-good.net/analyticsr/r-381/

Package version is 0.9.2. Checked with R version 4.2.2.

スポンサーリンク

Install Package

Run the following command.

#Install Package
install.packages("corrplot")

Example

See the command and package help for details.

#Loading the library
library("corrplot")

#Correlation coefficient calculation: stat package; cor command
#Use "mtcars" from darasets package for data
CorResult <- cor(mtcars, method = "pearson")

#Plotting results: corrplot command
#Specify plot contents:method option;"circle","square","ellipse",
#"number","shade","color","pie"
#Specify plot position: type option;full,lower,upper
#Symbol color:col option
corrplot(corr = CorResult, method = "ellipse", type = "upper",
         col = colorRampPalette(c("#a87963", "#4b61ba"))(10))

#Plotting with different plot contents at top and bottom: corrplot.mixed command
#Specify the contents of the lower plot: lower;
#the specified contents are common to the corrplot command
#Specify the contents of the upper plot: lower;
#the specified contents are common to the corrplot command
#Symbol color:col option
corrplot.mixed(corr = CorResult, lower = "square", upper = "number",
               lower.col = colorRampPalette(c("#a87963", "#4b61ba"))(10),
               upper.col = colorRampPalette(c("#a87963", "#4b61ba"))(10))

Output Example

・corrplot command

corrplot

・corrplot.mixed command

corrplot.mixed

I hope this makes your analysis a little easier !!

Amazon audibleの登録の紹介

プライム会員限定で2024年7月22日まで3か月無料体験キャンペーン開催中です。無料体験後は月額1,500円で聞き放題です。なお、聞き放題対象外の本はAudible会員であれば非会員価格の30%引きで購入することが可能です。

Amazon audibleはプロのナレーターが朗読した本をアプリで聞くことができるサービスで、オフライン再生も可能です。通勤や作業のお供にAmazon audibleのご登録はいかがでしょうか。

・AmazonのAudible

https://amzn.to/3L4FI5o

Copied title and URL