We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have noticed that some positive correlations between 0 and .30 are plotted in blue, while they should be plotted in red. I'm using this code:
CovidData <- read_spss(choose.files()) corrplot2 <- function(data, method = "pearson", sig.level = 0.05, order = "original", diag = FALSE, type = "upper", tl.srt = 90, number.font = 1, number.cex = .75, cl.cex = 1, tl.cex = 1, mar = c(0, 0, 0, 0)) { library(corrplot) data_incomplete <- data data <- data[complete.cases(data), ] mat <- cor(data, method = method) cor.mtest <- function(mat, method) { mat <- as.matrix(mat) n <- ncol(mat) p.mat <- matrix(NA, n, n) diag(p.mat) <- 0 for (i in 1:(n - 1)) { for (j in (i + 1):n) { tmp <- cor.test(mat[, i], mat[, j], method = method) p.mat[i, j] <- p.mat[j, i] <- tmp$p.value } } colnames(p.mat) <- rownames(p.mat) <- colnames(mat) p.mat } p.mat <- cor.mtest(data, method = method) col <- colorRampPalette(c("#4477AA", "#77AADD", "#FFFFFF", "#EE9988", "#BB4444")) corrplot(mat, method = "color", col = col(200), number.font = number.font, mar = mar, number.cex = number.cex, cl.cex = cl.cex, tl.cex = tl.cex, type = type, order = order, addCoef.col = "black", # add correlation coefficient tl.col = "black", tl.srt = tl.srt, # rotation of text labels # combine with significance level p.mat = p.mat, sig.level = sig.level, insig = "blank", # hide correlation coefficiens on the diagonal diag = diag ) } corrplot2( data = CovidData, method = "pearson", sig.level = 0.05, order = "original", diag = FALSE, type = "upper", tl.srt = 45 )
The text was updated successfully, but these errors were encountered:
@pelingul you can try toget the correct plot by setting full_col = FALSE
Sorry, something went wrong.
16c5ca7
Thanks.
I have removedfull_col and will update to CRAN soon.
full_col
Thank you very much @taiyun It is fixed!
No branches or pull requests
I have noticed that some positive correlations between 0 and .30 are plotted in blue, while they should be plotted in red. I'm using this code:
The text was updated successfully, but these errors were encountered: