Skip to content

Commit

Permalink
version 2.4-2
Browse files Browse the repository at this point in the history
  • Loading branch information
mk314199 authored and cran-robot committed Sep 26, 2016
1 parent ae74947 commit ba8400a
Show file tree
Hide file tree
Showing 88 changed files with 7,767 additions and 2,324 deletions.
18 changes: 11 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pcalg
Version: 2.2-4
Date: 2015-07-22
Version: 2.4-2
Date: 2016-09-21
Title: Methods for Graphical Models and Causal Inference
Description: Functions for causal structure
learning and causal inference using graphical models. The main algorithms
Expand All @@ -18,10 +18,14 @@ Authors@R: c(person("Markus","Kalisch",
person("Alain", "Hauser", role="aut"), person("Martin","Maechler", role="aut"),
person("Diego", "Colombo", role="ctb"), person("Doris", "Entner", role="ctb"),
person("Patrik","Hoyer", role="ctb"), person("Antti", "Hyttinen", role="ctb"),
person("Jonas", "Peters", role="ctb"))
person("Jonas", "Peters", role="ctb"), person("Nicoletta", "Andri",
role="ctb"), person("Emilija", "Perkovic", role="ctb"), person("Preetam",
"Nandy", role="ctb"), person("Philipp", "Ruetimann", role="ctb"),
person("Daniel", "Stekhoven", role="ctb"), person("Manuel", "Schuerch", role="ctb"))
Author: Markus Kalisch [aut, cre], Alain Hauser [aut], Martin Maechler [aut],
Diego Colombo [ctb], Doris Entner [ctb], Patrik Hoyer [ctb],
Antti Hyttinen [ctb], Jonas Peters [ctb]
Diego Colombo [ctb], Doris Entner [ctb], Patrik Hoyer [ctb], Antti Hyttinen [ctb],
Jonas Peters [ctb], Nicoletta Andri [ctb], Emilija Perkovic [ctb], Preetam Nandy [ctb],
Philipp Ruetimann [ctb], Daniel Stekhoven [ctb], Manuel Schuerch [ctb]
Depends: R (>= 3.0.2)
LinkingTo: Rcpp (>= 0.11.0), RcppArmadillo, BH
Imports: stats, graphics, utils, methods, abind, graph, RBGL, igraph,
Expand All @@ -33,6 +37,6 @@ NeedsCompilation: yes
Encoding: UTF-8
License: GPL (>= 2)
URL: http://pcalg.r-forge.r-project.org/
Packaged: 2015-07-22 14:53:53 UTC; maechler
Packaged: 2016-09-23 09:30:59 UTC; maechler
Repository: CRAN
Date/Publication: 2015-07-23 09:21:52
Date/Publication: 2016-09-26 16:47:02
162 changes: 86 additions & 76 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,152 +1,162 @@
1c213fc1c5a5ec68e7a5ba9293440dc3 *ChangeLog
72d5dbaaccf6f40326223c297b424933 *DESCRIPTION
bf71c6ddb1dc28860a71530ad66e32b8 *NAMESPACE
c0b16b9192154e0816f60ceeecb8af0f *R/Aaux.R
3a7fa47f867bd79a23e636e9973bc241 *R/AllClasses.R
0db7b58816246c6f934fdc99bbc296d7 *DESCRIPTION
6f25f81b0ff82b5c4480cb90eff1dde5 *NAMESPACE
66963591a11cfdb002f5da9070f1500b *R/Aaux.R
5085e29e474ce52b4ea5fba61d5ad003 *R/AllClasses.R
709461024e0516af39a962661e2930d0 *R/deprecated.R
bced89250587ee3eb4e5f5d3ccd07ab5 *R/gacFuns.R
6cf1f4d57cc0a920202e33f569bdac9c *R/genRandDAG.R
adecf819751e0b4bcf9de72e7d04a51e *R/gies.R
344228236787b8a3077d47b355342423 *R/jointIda.R
ffc1ac4b18dd263fcb0827c32a13a900 *R/lingamFuns.R
9649f2e6c9dc6c64e4836aed0943103f *R/pcalg.R
c0958d3ffcf9909629cad0a5980d360e *R/genRandDAG.R
58ff7ce957f0898b51a036318336090f *R/gies.R
07eb0f8f0d9432e3119ab7276ba592b7 *R/jointIda.R
386ed9be1a524de90dfac185433b009a *R/lingamFuns.R
1c5c600c1da1e2d4d4c54163938e1cc7 *R/pcalg.R
9187a45035684cf827be71af16325d2c *R/sysdata.rda
0db1ba6d57801a4d8fc6cdf996384a4d *R/zzz.R
19c9e7d6ccdf444ff479c1f7b7dfd0af *TODO
1dac936791d77cf63c94e78a3394238f *cleanup
d599e23940bca0203504c0fa6b09e01c *TODO
a9c25c5402e9df15259511faa9d1a721 *build/vignette.rds
f832779eae511757a99906c7670fc0ad *cleanup
7cbe431a233e6c454e24f7b92d63fe75 *data/datalist
1d8d4c43b9cbb9dc9dd57acd59f565bf *data/gmB.rda
52ed0493e175a338c2f12cc1c48a9f9b *data/gmD.rda
0c04f895b0adb530c7e8d4c6c503a842 *data/gmG.rda
6d96fac64134a91ecf0c244b4679ec0f *data/gmI.rda
01ad6c01910806745a34c7bc963c41b5 *data/gmInt.rda
385d41164301819ce274673db8743fc9 *data/gmInt.rda
1b3a78b432a5e46b991f5ae5eb4b77f3 *data/gmL.rda
811a9708268fbddd317bbca12ef93a55 *inst/CITATION
bd5974c599f2a4e7e29fcbf4accceb67 *inst/NEWS.Rd
47990df286c898e8821e60370c0b1e13 *inst/doc/mkVignettes.R
48cfd14676c835cce888970ebfcfae42 *inst/doc/pcalgDoc.pdf
2f13a20f69511d72dd63f9212308bc80 *inst/NEWS.Rd
4e33425acbef8bf36705d8a75622baa8 *inst/doc/mkVignettes.R
aa0819d2bcfb83844ff80ef66eeeafa7 *inst/doc/pcalgDoc.R
43598f8f02fb3b909c846a048c7360c8 *inst/doc/pcalgDoc.Rnw
c0a99493e33669ed2931c73e1e1ef2bf *inst/doc/pcalgDoc.pdf
cee0b4475c720bf58c466e1495451b22 *inst/external/N_6_1000.rds
0d84fdc119d76d992b72f9bdbd0e613d *inst/external/gac-pags.rds
e7a2a9117d97986b2ab6afc6b4f77478 *inst/external/test_conservative_pc_data1.rda
4dfbe2a4e41dc556b8812667b60d3549 *inst/external/test_conservative_pc_data2.rda
3e26e3a9f5736c6c9a28b9b0f1c178b2 *inst/include/pcalg/armaLapack.hpp
46f3b404de08d10a7028379313d69645 *inst/include/pcalg/constraint.hpp
5d01d1dbd1642b958494993d44f0b9bb *inst/include/pcalg/gies_debug.hpp
121f5b1748a7dca6032dc088de662034 *inst/include/pcalg/greedy.hpp
0c55a7e4825cac7fb2a1476888e2ba82 *inst/include/pcalg/score.hpp
29805523b6262448b7f609df27b0316b *inst/include/pcalg/gies_debug.hpp
1b36cef2466481f026f8dc31652bd3ca *inst/include/pcalg/greedy.hpp
57138081b90580b3734d87999d6b84ab *inst/include/pcalg/score.hpp
aa3405ae18b89d66c1a0315e0bdbccee *inst/xtraR/graph2ftmatrix.R
67d5c8bab6246e9245b352a245069a17 *man/EssGraph-class.Rd
146b7ce241783ddaa4627949ae1f370a *man/GaussL0penIntScore-class.Rd
ece5fe7ddfabe25249bb40c57200fb42 *man/GaussL0penObsScore-class.Rd
84f4260988cdcfafadee14e0bbe56cc9 *man/GaussParDAG-class.Rd
1708a0c5f8182965f3a160e9606aaab3 *man/LINGAM.Rd
4c1a2c4b81350916099f7952358f9550 *man/LINGAM.Rd
4733da421bc6790c136557833a08b0dc *man/ParDAG-class.Rd
7a629ea5557abb54fb86a81ae1659240 *man/Score-class.Rd
a20229f00ff57a30a20bf22c81c2522a *man/backdoor.Rd
84fcdb8aca0888d4a312f23d1c9ca46c *man/Score-class.Rd
8a41e2a67114f073aef8388fdf316531 *man/amatType.Rd
c78468dcaee10246f1e5370905773cfe *man/backdoor.Rd
6feb25e396846cbb7c1fc4de8d7e2eaa *man/beta.special.Rd
e5e54569fa1222405f18ee7c189b68cd *man/beta.special.pcObj.Rd
25029c568795bdac3d6f3b8e9e05326a *man/binCItest.Rd
985ad15e7c9d156d03ad9b58436c4e5d *man/checkTriple.Rd
966d0b8af075b8f40c5f1021abb41f67 *man/checkTriple.Rd
4b0dfb506510f7cf16ebc7e3e6fb6339 *man/compareGraphs.Rd
3c683afce27467e33642cb17d6ba5156 *man/condIndFisherZ.Rd
1db62c3d0a3767bfbc1107a2b7bde1dc *man/corGraph.Rd
b56f2c964ee246d2f91dd4c5a3d526e5 *man/dag2cpdag.Rd
f5bb502b04b5243c0f1a715c35205d15 *man/dag2essgraph.Rd
297092d27f80a859b5d89a49a54926d1 *man/condIndFisherZ.Rd
b2ded6b2c0cd2cf0c30b845d07646736 *man/corGraph.Rd
f320034a84ee39090a1bf0596532772c *man/dag2cpdag.Rd
e57b4c2a4aec589210e386b72c2333fd *man/dag2essgraph.Rd
9825306a115fb2370a8bf8d481284983 *man/dag2pag.Rd
4e804b480585e6a4d57b1ac0f6100760 *man/disCItest.Rd
9b098d0a60f3a3aad11eae3f582995aa *man/dreach.Rd
3d880e7f58fe68731e9ed4ecb4c13bf4 *man/dreach.Rd
e89cc00623c136f141b0427a7476889a *man/dsep.Rd
489e0cd6d854d9915368baa1803ff990 *man/dsepTest.Rd
305e579276cbc7133576a3175e81b01f *man/fci.Rd
e0951363e609e9b1827b03fc3b9cedbe *man/fciAlgo-class.Rd
d2d67c5c2f232189a81ce6177a834577 *man/fciPlus.Rd
6c654742667b21e8c40e43ccda32a229 *man/find.unsh.triple.Rd
3c0924e854ffc20b168281b2380d9b61 *man/dsepTest.Rd
771fa91efa266d4ffcb1818077481a4f *man/fci.Rd
4210c617d4929290e295ced5e0eeeb43 *man/fciAlgo-class.Rd
7fb4c8797b23d3d73252beee2610d45f *man/fciPlus.Rd
44127d2a6a6234ed84cf650a3273e504 *man/find.unsh.triple.Rd
efed404b8bbbd6700520e6587d65d4ac *man/gAlgo-class.Rd
c02e1c7a066c595f58a6579c9f7bbd4a *man/gac.Rd
730b0cfa6bf222f070fabba144266d35 *man/gds.Rd
bb85025474a5b643644d9ab5aef842c0 *man/ges.Rd
6a4c08062ceace6c18475cdbe3537a17 *man/gac.Rd
cb526c1eceaf53b0239c888ecbbdbbaf *man/gds.Rd
a30b09aa0afd2979e7bda56aa6e64224 *man/ges.Rd
fdc0ad5d17fff5f2c8734504041af969 *man/getGraph.Rd
f7e5c22255b62a23431b08c2d3080b66 *man/getNextSet.Rd
187eb5ab007e8552c53e1becc80011df *man/gies.Rd
af8d2172db60544ae8e42676de890378 *man/gies.Rd
cbb33c4976caf365b69cb9c76a7a493e *man/gmB.Rd
5d6bd5e0a6ddce6b8b4dae1dc02bd26c *man/gmD.Rd
bfbfa5083afa919d56c211768f8b2d77 *man/gmG.Rd
66a7855809f1fd6e9a0ced7dbd612af6 *man/gmI.Rd
6a624691a6a19dd55526a9e9585ce0b3 *man/gmInt.Rd
0fc0725cd27113dfa0505deb9504b3ec *man/gmL.Rd
e249a045741380bb24994f464ce9e124 *man/ida.Rd
b1f8449bbf5fa4afbad9576ca94608f6 *man/idaFast.Rd
5ee7f4d28bc6ff22f49637600dd6c8d5 *man/ida.Rd
7aa46e96c96d02d55e876f3d52c2d5d7 *man/idaFast.Rd
90a088350b43454d621b4b315ab3d2cf *man/iplotPC.Rd
58b13b54e3cb4c41c9973acbb894602b *man/jointIda.Rd
57676fbcb3aa706227b17ad21f67ae3d *man/legal.path.Rd
1e5c083539584525a62b4f0cd478f60d *man/mat2targets.Rd
50527fcf426515db143b7ce841138a39 *man/jointIda.Rd
240d9c697a86a1aad34a623a487d3f5e *man/legal.path.Rd
7c28e6a542763fa65c25784a96d32e1f *man/mat2targets.Rd
cd8a6e38249822fc7c54c66b96a6a967 *man/mcor.Rd
acc07ba5a8ab44b3e4a1d7130541cc27 *man/pag2mag.Rd
7c357eb02d8560fe13492af42276564f *man/pc.Rd
2ae695c62f2c7831eb2595a8f569e602 *man/pc.cons.intern.Rd
0a89d7e11b03c0b0580f70cdf0103deb *man/pcAlgo-class.Rd
67426f4203b1334a56a8715423083745 *man/pag2mag.Rd
7087d3196d5864e45e7e2a4099a2f44b *man/pc.Rd
01d980deb40fe93c7e3c2f5039882f9d *man/pc.cons.intern.Rd
3602e10d2bc8dd7eba856c8c516e4b57 *man/pcAlgo-class.Rd
143110b2d6797b5ef727a5c05d2790f8 *man/pcAlgo.Rd
ead3182858e088744ab17467c15b2211 *man/pcSelect.Rd
ef7c030654d7a92a9664076d2a0eac5f *man/pcSelect.presel.Rd
da2af80714506529ddd6beba2a0f9730 *man/pcalg-internal.Rd
88cd7178faf6a1f8ab04ba0e74f24e0b *man/pcorOrder.Rd
69e62cafe0cebc0d0d4faac5ad06408e *man/pcorOrder.Rd
800c3348670b4ca01c406d5e5d67839c *man/pdag2allDags.Rd
208807c0c6b5ead3e89f414adc9136c1 *man/pdag2dag.Rd
300bfb3daac73f63c1eb49bfb6394626 *man/pdsep.Rd
455c45697da640068f415fa95e9d0f79 *man/pdsep.Rd
89b20dd90d54188d453dde9d8ca13d07 *man/plotAG.Rd
653d3378964e4452b39b37b5232e0710 *man/plotSG.Rd
2bbb8c781e491ab934fb63c8d2a5bce4 *man/possibleDe.Rd
44721d7643ca55ffcad06065550a51b0 *man/qreach.Rd
cd2ff5db948044a7784ca18d5b9e7562 *man/plotSG.Rd
fef9da909abe58d5e9f0831235db6cc4 *man/possibleDe.Rd
5782fc04b6408ebfc706d4d43d232fb1 *man/qreach.Rd
d0196c418afe2af7c6bf89cd2a5d18e5 *man/r.gauss.pardag.Rd
d50b953ca9aeab50d864e88725eab49b *man/randDAG.Rd
31eca391a909dfc4cc61d91b10e40128 *man/randDAG.Rd
d28b8fbb54c9bdd378363a74325fcb8a *man/randomDAG.Rd
98dbfb7e8b5ad7a813ee70b3105ac1fd *man/rfci.Rd
126a7ce6f483d58ce9e17bcb7cf81b49 *man/rfci.Rd
d6eb86a8b2f04f416a59792f35cdaa2c *man/rmvDAG.Rd
27ab6d09110842495dd1b29fc14f1543 *man/rmvnorm.ivent.Rd
727b7b67d395b6f78abc4c3a55861382 *man/shd.Rd
e7e9595f3b10daac9dff67ee6ee2f3c3 *man/showAmat.Rd
f9e8f9a3f798f74875efa4e6834ddf67 *man/showAmat.Rd
146a479ea21765cd4b39a6c9023537e5 *man/showEdgeList.Rd
91bae38a853c228f88238ce3702d9e34 *man/simy.Rd
ebe7d3e6502076c8227ea3d9d415823d *man/skeleton.Rd
1c97ce27a92eb4ee8e87365904cd4106 *man/simy.Rd
aa5ef5fcc6669f7fe4e7c71cbc977dff *man/skeleton.Rd
1fd827271a88b3c218d7a4fec743fb7e *man/trueCov.Rd
6f6dbe29cd159577461509d101631c3a *man/udag2apag.Rd
3fd1dadc6b742137aece64afd2675bb0 *man/udag2pag.Rd
f5433522bb64ffd4623fb43817d5e06d *man/udag2pdag.Rd
336bd3f58604f1455e50ab4bffab4294 *man/unifDAG.Rd
0cbd2940967c142e025833d646b83053 *man/visibleEdge.Rd
6cf72cedd7cb73647586c65753dbd68f *man/udag2apag.Rd
15de4fbe76e6800999fcc014adf3bd21 *man/udag2pag.Rd
3f19bdfb286f52acc97cc8f985cd02af *man/udag2pdag.Rd
7d946c76d88711cd0313b051923d728f *man/unifDAG.Rd
abddab27448a30a0f87aea03c467e0ee *man/visibleEdge.Rd
0c704ef6f6822e7ec9dca44b4676eb9f *man/wgtMatrix.Rd
552b72ff784732d0a19ca3971a757291 *src/Makevars
c0b0045ea1c93212805e2221a2430419 *src/Makevars.win
0f0107546301dbbf5d84c3c73f0ba6be *src/constraint.cpp
906bf4e048d48761bbba140dd143d74e *src/gies.cpp
98afb8dfa2fd02134507511c207b72ad *src/greedy.cpp
0c404ef330cd447453260446f898a97d *src/score.cpp
0a42f766b2298588b51663ee586508d7 *src/Makevars.win
2ced878a9b224e806d51885fafbfa64d *src/constraint.cpp
fa352940accd184b6599e5e52609f8d1 *src/gies.cpp
e3db3f776260f352929fbe85b5000b5b *src/greedy.cpp
bc5cab68e323949bed42d3d87b68e5a2 *src/score.cpp
83187ba1f22cdb1b239e07027ddf489a *tests/discr100k.rda
f417aa1bd7c3493e07dcf7f9e2a021ff *tests/gacData.rda
f05a0e067c31279e29a2ad4101293589 *tests/test_LINGAM.R
e55f723241bfbf463ec914b2bcc694d0 *tests/test_LINGAM.R
3e75e91dc9507a780c188cd62c65636b *tests/test_amat2dag.R
f42c5cdb181390a941302634ad7080aa *tests/test_arges.R
886fbfd89fe8a61662163fa2df73ed98 *tests/test_backdoor.R
22798bd30fcb6cead206e33e37ee0005 *tests/test_backdoor.Rout.save
a04391fee2aff151ea84e39b43d6626f *tests/test_bicscore.R
7e1885e05cb8aa0014656e5da038fa7c *tests/test_bicscore.R
68d7fc06c8751108a3f33af93956220e *tests/test_bicscore.rda
319ad79c662ff38c00230095cb0ed7f5 *tests/test_causalEffect.R
34e640c8ea2bd339b3de3a165ee9e693 *tests/test_compareGraphs.R
8227eb269c25cb458eb571ccd1550ed1 *tests/test_dag2cpdag.R
ac433f470680b808ba31c6af0630b995 *tests/test_dag2essgraph.R
6ce990fb8ff052b09c27abe59affb678 *tests/test_displayAmat.R
e11611f462df230cc44fc3571c714a87 *tests/test_dsep.R
89771d8a241abec27b4a3aaa729c1cd0 *tests/test_fci.R
580f7daaaf9136c97c4996442472fd09 *tests/test_fciPlus.R
5616660b37eb067761dfcd31c0251dc8 *tests/test_gSquareBin.R
254a3313c718ccb259af7da4170560ce *tests/test_gSquareDis.R
ae7d1151cae52ac33c9565d5765e8c04 *tests/test_gac.R
62df22839190befd25174cf3d6b7291e *tests/test_getNextSet.R
62581bba936e7119efac49ddd4dc6cbe *tests/test_gies.R
a61f759b18b2ab67fd7d5270bb796028 *tests/test_gac.R
c485aeb5ea3b876b560961245eefeef5 *tests/test_getNextSet.R
51842251933a1ec6a71f0dff0a86e25a *tests/test_gies.R
026eda288c19708953516ee13b1ee8e0 *tests/test_ida.R
a1e602bf613715d98720c97fd1f33508 *tests/test_idaFast.R
fa03439e1ca384721d7437519216d75e *tests/test_jointIda.R
42946d1b228bfe3aefc8e8f0326dbf18 *tests/test_mat2targets.R
36698c5a2890cba1dc1998623a1a8ede *tests/test_mat2targets.R
cd913f44dcba8673b0839dc90c1772c5 *tests/test_pc.R
5bc4f47a900d94f0d39b7d8aec54e215 *tests/test_pcSelect.R
88820e832f56e6714216c8aed404fd2c *tests/test_pcSelect.R
ecaacf0c68bf72d9d96eeeeffd824357 *tests/test_pcorOrder.R
67fbdda0dd8ab5f4fbd185ee85916d12 *tests/test_pdag2allDags.R
76fd1ade1f75af8bbdcc8d88b655fbdc *tests/test_pdag2dag.R
1703ad3e6c39b3db6066fdf3038b27cf *tests/test_randDAG.R
80b2fbd129b4dc711c790ccc559a6247 *tests/test_randDAG.Rout.save
9892d6cb3e3135fd456e84068b39eaa8 *tests/test_randDAG.R
f1f854473da4d9e5245b1bade561acf7 *tests/test_randDAG.Rout.save
aee8ad2108a151b25666eaf0ed1b4205 *tests/test_randomDAG.R
ff3c8f14106ff1abd140b6bd018dec50 *tests/test_rfci.R
7853e03d1c258ed44b17debd5812ac71 *tests/test_rmvDAG.R
Expand All @@ -159,4 +169,4 @@ cd40b46d3274a112953423a19f78d4c4 *tests/test_wgtMatrix.R
35fe720fff87739bb6b7bfe79d204d33 *vignettes/Figure2FAT.pdf
f930246d4cfb62c9d2fb0d954be5042d *vignettes/Mybib.bib
b9564ddd59a06782310989e8f33db55e *vignettes/jsslogo.jpg
5d1cffaf8fa0e09882b92d5f6c5f95ee *vignettes/pcalgDoc.Rnw
43598f8f02fb3b909c846a048c7360c8 *vignettes/pcalgDoc.Rnw
18 changes: 13 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ importFrom("utils", combn, str)

importFrom("graphics", par, plot.default, plot, title)

## try to import all we need, but not more
importMethodsFrom("methods", coerce, show)
importFrom("methods",
setClass, setClassUnion, setMethod, setOldClass, setValidity,
getClass, getClassDef, callGeneric, as, is, extends,
Expand Down Expand Up @@ -132,15 +132,18 @@ export(trueCov,
gds,
simy,
mat2targets,
# targets2mat,
targets2mat,
dag2essgraph,
## --- end{Alain}
fciPlus,
LINGAM,
lingam, LINGAM,
randDAG,
unifDAG,
unifDAG.approx,
gac)
gac,
## no longer: use as(*,"amat")
## displayAmat,
pdag2allDags)

## These are "internal" i.e., in man/pcalg-internal.Rd
## _FIXME ?_ ---------------------
Expand Down Expand Up @@ -173,7 +176,12 @@ exportClasses("pcAlgo",
"GaussL0penObsScore",
"EssGraph")

exportMethods("summary", "show", "plot")
exportMethods(# needed? "coerce",# <- defined via setAs(., ..) used via as(A, "class_B")
"summary", "show", "plot")

S3method(print, fciAlgo)
S3method(print, pcAlgo)
S3method(print, amat)
## FIXME: TODO
# S3method(print, LINGAM)

41 changes: 41 additions & 0 deletions R/Aaux.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,47 @@
log.q1pm <- function(r) log1p(2*r/(1-r))


## MM: "Lifted" from Matrix package ~/R/Pkgs/Matrix/R/Auxiliaries.R
## "Theory" behind this: /u/maechler/R/MM/MISC/lower-tri-w.o-matrix.R
indTri <- function(n, upper = TRUE, diag = FALSE) {
## Indices of (strict) upper/lower triangular part
## == which(upper.tri(diag(n), diag=diag) or
## which(lower.tri(diag(n), diag=diag) -- but
## more efficiently for largish 'n'
stopifnot(length(n) == 1, n == (n. <- as.integer(n)), (n <- n.) >= 0)
if(n <= 2) {
if(n == 0) return(integer(0))
if(n == 1) return(if(diag) 1L else integer(0))
## else n == 2
v <- if(upper) 3L else 2L
return(if(diag) c(1L, v, 4L) else v)
}

## n >= 3 [also for n == 2 && diag (==TRUE)] :

## First, compute the 'diff(.)' of the result [fast, using integers]
n. <- if(diag) n else n - 1L
n1 <- n. - 1L
## all '1' but a few
r <- rep.int(1L, choose(n.+1, 2) - 1)
tt <- if(diag) 2L else 3L
r[cumsum(if(upper) 1:n1 else n.:2)] <- if(upper) n:tt else tt:n
## now have differences; revert to "original":
cumsum(c(if(diag) 1L else if(upper) n+1L else 2L, r))
}

##' Count Edges, for directed graphs, *not* as numEdges(g)
##' but such that "<-->" or "<--o" ... counts as 1
##' (for undirected graphs, this is the same as numEdges(.))
numGedges <- function(amat) {
dimnames(amat) <- NULL # speed
A <- (amat + t(amat)) != 0
n <- nrow(A)
if(n <= 40) ## faster
sum(A[lower.tri(A)])
else
sum(A[indTri(n)])
}

check.Rgraphviz <- function() {
if(!requireNamespace("Rgraphviz"))
Expand Down
Loading

0 comments on commit ba8400a

Please sign in to comment.