corrplot fix title cut off type='upper'
When creating a correlation plot using type="upper"
, the default settings will cut off the title in the plot.
Add an upper margin to fix mar=c(0,0,2,0)
.
library(datasets)
library(corrplot)
data(iris)
# Select the numeric columns
irisNumeric <- Filter(is.numeric, iris)
# Compute the correlation matrix
irisCor <- cor(irisNumeric)
corrplot(irisCor, method="color",
type="upper",
title="Correlation Plot: No Margin",
tl.col="black", tl.srt=0,
diag=FALSE)
corrplot(irisCor, method="color",
type="upper",
title="Correlation Plot: mar = c(0,0,2,0)",
tl.col="black", tl.srt=0,
# Margin added here
mar=c(0,0,2,0),
diag=FALSE)
Rename column names with dplyr
Read a file with one valid JSON object per line with R and jsonlite