Giter Site home page Giter Site logo

corrgram's People

Contributors

bfgray3 avatar jacobhurst avatar kwstat avatar matthieu-bruneaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

corrgram's Issues

wish: corrgram to respect par(mar)

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

corrgram, mclust and maximal DLL error

@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)

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 LC_NUMERIC=C

[3] LC_TIME=en_IN.UTF-8 LC_COLLATE=en_IN.UTF-8

[5] LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_IN.UTF-8

[7] LC_PAPER=en_IN.UTF-8 LC_NAME=en_IN.UTF-8

[9] LC_ADDRESS=en_IN.UTF-8 LC_TELEPHONE=en_IN.UTF-8

[11] LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=en_IN.UTF-8

attached base packages:

[1] splines grid parallel stats graphics grDevices utils

[8] datasets methods base

other attached packages:

[1] skimr_1.0 pillar_1.0.1 likert_1.3.5

[4] xtable_1.8-2 Rcmdr_2.4-1 effects_4.0-0

[7] carData_3.0-0 RcmdrMisc_1.0-7 sandwich_2.4-0

[10] WRS2_0.9-2 pastecs_1.3-18 boot_1.3-20

[13] multcomp_1.4-8 TH.data_1.0-8 MASS_7.3-48

[16] mvtnorm_1.0-6 car_2.1-6 compute.es_0.2-4

[19] DMwR2_0.0.2 DMwR_0.4.1 lattice_0.20-35

[22] VIM_4.7.0 data.table_1.10.4-3 colorspace_1.3-2

[25] visdat_0.1.0 lubridate_1.7.1 kableExtra_0.6.1

[28] SnowballC_0.5.1 wordcloud_2.5 rJava_0.9-9

[31] Rgraphviz_2.14.0 graph_1.40.1 bnlearn_4.2

[34] scales_0.5.0 ggplot2_2.2.1 qdap_2.2.9

[37] RColorBrewer_1.1-2 qdapTools_1.3.3 qdapRegex_0.7.2

[40] qdapDictionaries_1.0.6 tm_0.7-3 NLP_0.1-11

[43] plspm_0.4.9 plsdepot_0.1.17 bindrcpp_0.2

[46] readr_1.1.1 survey_3.32-1 survival_2.41-3

[49] Matrix_1.2-12 tibble_1.4.1 dplyr_0.7.4

[52] igraph_1.1.2 phantom_0.1.2 Biobase_2.22.0

[55] BiocGenerics_0.8.0 webshot_0.5.0 png_0.1-7

[58] rsvg_1.1 svglite_1.2.1 magrittr_1.5

[61] DiagrammeRsvg_0.1 htmlwidgets_0.9 DiagrammeR_0.9.2

[64] broman_0.67-4 rmarkdown_1.8 bookdown_0.5

[67] knitr_1.18

loaded via a namespace (and not attached):

[1] tidyselect_0.2.3 lme4_1.1-15 diagram_1.6.4

[4] munsell_0.4.3 codetools_0.2-15 chron_2.3-51

[7] tester_0.1.7 rgexf_0.15.3 rstudioapi_0.7

[10] stats4_3.4.3 ROCR_1.0-7 robustbase_0.92-8

[13] vcd_1.4-1 TTR_0.23-2 NMF_0.20.6

[16] slam_0.1-42 mnormt_1.5-5 openNLPdata_1.5.3-4

[19] rprojroot_1.3-2 downloader_0.4 R6_2.2.2

[22] doParallel_1.0.11 reshape_0.8.7 bitops_1.0-6

[25] assertthat_0.2.0 nnet_7.3-12 gtable_0.2.0

[28] xlsx_0.5.7 rlang_0.1.6 MatrixModels_0.4-1

[31] lazyeval_0.2.1 acepack_1.4.1 checkmate_1.8.5

[34] brew_1.0-6 yaml_2.1.16 reshape2_1.4.3

[37] abind_1.4-3 backports_1.1.2 quantmod_0.4-12

[40] Hmisc_4.1-1 tcltk_3.4.3 tools_3.4.3

[43] psych_1.7.8 influenceR_0.1.0 gridBase_0.4-7

[46] gplots_3.0.1 Rcpp_0.12.14 plyr_1.8.4

[49] base64enc_0.1-3 visNetwork_2.0.2 purrr_0.2.4

[52] RCurl_1.95-4.10 rpart_4.1-11 viridis_0.4.0

[55] openNLP_0.2-6 zoo_1.7-12 haven_1.1.0

[58] cluster_2.0.6 SparseM_1.77 lmtest_0.9-34

[61] amap_0.8-14 hms_0.4.0 xlsxjars_0.6.1

[64] evaluate_0.10.1 pbkrtest_0.4-7 XML_3.98-1.9

[67] readxl_1.0.0 gridExtra_2.3 shape_1.4.3

[70] compiler_3.4.3 crayon_1.3.4 KernSmooth_2.23-15

[73] V8_1.5 gender_0.5.1 minqa_1.2.4

[76] htmltools_0.3.6 mc2d_0.1-18 mgcv_1.8-22

[79] venneuler_1.1-0 Formula_1.2-2 tidyr_0.7.2

[82] DBI_0.7 relimp_1.0-5 gdata_2.18.0

[85] bindr_0.1 forcats_0.2.0 pkgconfig_2.0.1

[88] registry_0.5 foreign_0.8-69 laeken_0.4.6

[91] sp_1.2-5 xml2_1.1.1 foreach_1.4.4

[94] rngtools_1.2.4 pkgmaker_0.22 rvest_0.3.2

[97] stringr_1.2.0 digest_0.6.13 cellranger_1.1.0

[100] htmlTable_1.11.1 Rook_1.1-1 nortest_1.0-4

[103] gdtools_0.1.6 curl_3.1 turner_0.1.7

[106] gtools_3.5.0 reports_0.1.4 quantreg_5.34

[109] nloptr_1.0.4 nlme_3.1-131 jsonlite_1.5

[112] viridisLite_0.2.0 httr_1.3.1 plotrix_3.7

[115] DEoptimR_1.0-4 glue_1.2.0 xts_0.10-1

[118] iterators_1.0.9 pander_0.6.1 tcltk2_1.2-11

[121] class_7.3-14 stringi_1.1.6 latticeExtra_0.6-28

[124] caTools_1.17.1 e1071_1.6-8`

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

Corrgram in shiny

Hi,

Can we use corrgram plots in shiny applications. If yes, can you please share a workable example.

Regards

Pearson correlations in panel.conf, even though Spearman requested

I noticed the following thing (and sorry for the lack of a reproducible example, this is my first GitHub issue):

  • Taking Pearson correlations, the correlations match the pies (see e.g. correlation between tiredness and clarity).

image

  • Taking Spearman correlations, the upper panel still indicates Pearson correlations, though pies in the lower panel show the Spearman correlations:

image

This seems to happen with all my data. Corrgram version is 1.12.

Not loading the package to namespace: Object [panel.conf/panel.pie etc.] not found

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

Color scale legend

Is it possible to get a legend of the selected color palette? Something like the output of fields::image.plot function.

Wish: shading without density lines?

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

Label ordering mismatch issue when using both "order=T" and "labels" arguments

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!

Labels getting corrupted

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?
Screen Shot 2019-11-03 at 1 57 59 PM

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")

Misleading text sizes for panel.cor

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

Misleading vignette title

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

installation

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...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.