kwstat / corrgram Goto Github PK
View Code? Open in Web Editor NEWCorrelograms
Home Page: http://kwstat.github.io/corrgram/
License: Other
Correlograms
Home Page: http://kwstat.github.io/corrgram/
License: Other
Hi Kevin,
it's me again ... Thanks for reacting so promptly to previous comments! This time, I have a more difficult one (I believe): it's hard to impossible to add annotation or a legend to a corrgram, due to the fact that you manipulate par
settings in the function and reset them to previous state before exiting.
If corrgram would add a legend itself (is this still on your TODO list?), this might be OK. However, it's almost impossible to anticipate all user needs in advance, and it would therefore, in my opinion, be very useful if corrgram would respect a user's margin settings and allow users to write, plot, ... to those margins subsequently. If this is not possible because of the function's design, there could be an option that prevents the reverting of par
to its previous state, so that the user can work with the resulting figure (like e.g. done in package kohonen for plotting SOMs).
Best, Ulrike
@kwstat , this error while working with a big document like 250 pages + several R packages, see session info
Quitting from lines 3899-3900 (thesis-ajay.Rmd) Error: package or namespace load failed for 'corrgram' in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/ajay/R/x86_64-pc-linux-gnu-library/3.4/mclust/libs/mclust.so':
maximal number of DLLs reached...
Please delete thesis-ajay.Rmd after you finish debugging the error.
Execution halted
Exited with status 1.`
Session info
`## R version 3.4.3 (2017-11-30)
But the same code for corrgram produces nice plot output if ran in separate Rmd file, session info
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 18.3
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_IN.UTF-8
[3] LC_TIME=en_IN.UTF-8
[5] LC_MONETARY=en_IN.UTF-8
[7] LC_PAPER=en_IN.UTF-8
[9] LC_ADDRESS=C
[11] LC_MEASUREMENT=en_IN.UTF-8
LC_NUMERIC=C
LC_COLLATE=en_IN.UTF-8
LC_MESSAGES=en_IN.UTF-8
LC_NAME=C
LC_TELEPHONE=C
LC_IDENTIFICATION=C
attached base packages:
[1] stats
graphics grDevices utils
other attached packages:
[1] ellipse_0.4.1
corrgram_1.12
[5] kableExtra_0.6.1 readr_1.1.1
datasets
corrr_0.2.1
knitr_1.18
loaded via a namespace (and not attached):
[1] viridis_0.4.0
httr_1.3.1
[4] foreach_1.4.4
gtools_3.5.0
[7] highr_0.6
stats4_3.4.3
[10] robustbase_0.92-8 pillar_1.0.1
[13] lattice_0.20-35
glue_1.2.0
[16] rvest_0.3.2
colorspace_1.3-2
[19] plyr_1.8.4
pkgconfig_2.0.1
[22] mvtnorm_1.0-6
scales_0.5.0
[25] whisker_0.3-2
tibble_1.4.1
[28] nnet_7.3-12
lazyeval_0.2.1
[31] mclust_5.4
evaluate_0.10.1
[34] gplots_3.0.1
xml2_1.1.1
[37] tools_3.4.3
registry_0.5
[40] trimcluster_0.1-2 stringr_1.2.0
[43] munsell_0.4.3
cluster_2.0.6
[46] bindrcpp_0.2
compiler_3.4.3
[49] rlang_0.1.6
grid_3.4.3
[52] bitops_1.0-6
rmarkdown_1.8
[55] codetools_0.2-15
flexmix_2.3-14
[58] R6_2.2.2
seriation_1.2-2
[61] prabclus_2.2-6
bindr_0.1
[64] KernSmooth_2.23-15 dendextend_1.6.0
[67] stringi_1.1.6
Rcpp_0.12.14
3
methods
base
dplyr_0.7.4
viridisLite_0.2.0
assertthat_0.2.0
yaml_2.1.16
backports_1.1.2
Hi,
Can we use corrgram plots in shiny applications. If yes, can you please share a workable example.
Regards
I noticed the following thing (and sorry for the lack of a reproducible example, this is my first GitHub issue):
This seems to happen with all my data. Corrgram version is 1.12.
Hi,
Apologies in advance if I'm doing something stupid here, but I've been getting a weird error for a while.
var1 <- rnorm(n = 700, mean = 100, sd = 20)
var2 <- rnorm(n = 700, mean = 100, sd = 20)
var3 <- rnorm(n = 700, mean = 100, sd = 20)
var4 <- rnorm(n = 700, mean = 100, sd = 20)
corrgram::corrgram(data.frame(var1, var2, var3, var4), upper.panel = panel.conf)
This gives me:
Error in corrgram::corrgram(data.frame(var1, var2, var3, var4), upper.panel = panel.conf) :
object 'panel.conf' not found
The documentation speaks about a "tall" format data frame, but making the df long doesn't help
data.frame(var1, var2, var3, var4) %>%
gather(variable, value, var1:var4) %>%
corrgram::corrgram(., upper.panel = panel.conf)
Many thanks for your help!
R 3.4.3, corrgram 1.12
Is it possible to get a legend of the selected color palette? Something like the output of fields::image.plot function.
Hi Kevin,
I dearly miss a possibility to remove the density lines for shading; I find them quite distracting and simply cannot see any reason for showing them. Is there any chance for an option to function panel.shade
that allows density shading to be removed? I can of course do my own function, but I think that this would just be better without the lines for (almost) everybody ...
Best, Ulrike
I've reinstalled both viridis an viridisLite, and still get same error. Same error with: library(viridis), so looks like it could be a viridis bug rather than a corrgram?
Hi,
I was recently confounded at some unexpected differences in the correlation estimates for a given pair of variables shown in corrgram plots for the same input data, depending on whether I used or not "order = T" and provided some labels to replace the column names of the input data frame.
After some time I realised it was just a matter of the labels not being ordered on the plot when I provide them myself with the "labels" argument.
Here is an example:
corrgram(mtcars, lower.panel = panel.conf) # Correlation between mpg and hp is -0.78
corrgram(mtcars, lower.panel = panel.conf, order = T) # Still ok
# Now if I want to replace the label "hp" by "horse\npower"
myLabels = names(mtcars)
myLabels[myLabels == "hp"] = "horse\npower"
corrgram(mtcars, lower.panel = panel.conf, labels = myLabels) # Still ok
corrgram(mtcars, lower.panel = panel.conf, labels = myLabels, order = T) # Not ok anymore
In the last plot the upper and lower panels are correctly reorder, but the labels I provided to the function are not reordered, resulting in a mismatch between the labels and the actual rows/columns.
I guess this could be either fixed in the corrgram function code so that labels are correctly ordered, or it could be said explicitly in the help for the corrgram function that if the user provides labels they will not be reordered.
I can try to modify the function to reorder provided labels and submit a patch if you think this is the best way?
Thank you for this very nice package!
Hello,
I created a corrgram off some network captures. However, the text labels are getting cropped.
I played around with the angles but it does not solve the issue. Any ideas on what is causing or how to correct?
Code utilized:
corrgram(df_stats, order=NULL, lower.panel=panel.shade,
upper.panel=NULL, text.panel=panel.txt,label.srt=5,
main="PCAP variables Correlation")
Hi Kevin,
currently, for autosizing of text, negative numbers have a smaller cex
than positive ones in panel.cor
, which gives a misleading visual impression especially when comparing e.g. -0.89 to 0.23. I know too little about how panel functions operate to offer a professional fix; I have made a workaround for myself that calculates the string width from formatted forced negative values.
Best, Ulrike
Hi Kevin,
the vignette title "cov2cor() may not give a valid correlation matrix" is a bit misleading in that it seems to blame cov2cor
for some wrong-doing. If given a proper covariance matrix, cov2cor
does give a valid correlation matrix. The matrix you use in the vignette has a negative eigen value and can therefore not have arisen as a covariance matrix:
> eigen(vv)$values
[1] 4.808047e+02 9.965048e+01 4.595154e+01 2.657509e+01
[5] 8.304329e+00 6.685001e-04 -8.147905e-04
If the negative eigen value is eliminated, the result of cov2cor
becomes a proper correlation matrix:
P <- eigen(vv)$vectors
cov2cor(P[,-7]%*%diag(eigen(vv)$values[1:6])%*%t(P[,-7]))
Best, Ulrike
Could not installing from CRAN in R Studio, but easy installed when I download it locally, but still not installing... for some reason... problem with dependencies...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.