/usr/lib/R/site-library/phangorn/doc/Networx.R is in r-cran-phangorn 1.99.14-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ## ---- eval=TRUE----------------------------------------------------------
library(phangorn)
data(Laurasiatherian)
data(yeast)
## ---- eval=TRUE----------------------------------------------------------
set.seed(1)
bs <- bootstrap.phyDat(yeast, FUN = function(x)nj(dist.hamming(x)),
bs=100)
tree <- nj(dist.hamming(yeast))
par("mar" = rep(2, 4))
tree <- plotBS(tree, bs, "phylogram")
cnet <- consensusNet(bs, .3)
plot(cnet, "2D", show.edge.label=TRUE)
## ---- eval=FALSE---------------------------------------------------------
# plot(cnet)
# # rotate 3d plot
# play3d(spin3d(axis=c(0,1,0), rpm=6), duration=10)
# # create animated gif file
# movie3d(spin3d(axis=c(0,1,0), rpm=6), duration=10)
## ---- eval=TRUE----------------------------------------------------------
dm <- dist.hamming(yeast)
nnet <- neighborNet(dm)
par("mar" = rep(2, 4))
plot(nnet, "2D")
## ---- eval=TRUE----------------------------------------------------------
nnet <- addConfidences(nnet, tree)
par("mar" = rep(2, 4))
plot(nnet, "2D", show.edge.label=TRUE)
## ---- eval=TRUE----------------------------------------------------------
tree2 <- rNNI(tree, 2)
tree2 <- addConfidences(tree2, tree)
# several support values are missing
plot(tree2, show.node.label=TRUE)
## ---- eval=TRUE----------------------------------------------------------
cnet <- nnls.networx(cnet, dm)
par("mar" = rep(2, 4))
plot(cnet, "2D", show.edge.label=TRUE)
|