Skip to content

Commit dc271f5

Browse files
committed
fixes #14
1 parent fba526e commit dc271f5

21 files changed

+9
-8
lines changed

R/tree.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ tree.layout <- function(phy, type='r', unscaled=FALSE) {
137137
}
138138
else if (type=='u') {
139139
# unrooted
140-
.layout.equalangle(phy, unscaled)
140+
.layout.equalangle(phy, unscaled=unscaled)
141141
}
142142
else if (type == 'o') {
143143
# circular (radial)
144-
.layout.radial(phy, unscaled)
144+
.layout.radial(phy, unscaled=unscaled)
145145
}
146146
else {
147147
stop("Unrecognized layout type '", type, "'")
@@ -271,7 +271,7 @@ print.phyloLayout <- function(obj) {
271271
# unrooting destroys internal node labels
272272
phy$node.label <- paste("Node", 1:Nnode(phy), sep='')
273273
}
274-
pd <- as.phyloData(phy, unscaled)
274+
pd <- as.phyloData(phy, unscaled=unscaled)
275275

276276
# allocate new node attributes
277277
pd$nodes$start <- NA
@@ -340,8 +340,8 @@ print.phyloLayout <- function(obj) {
340340
last.start <- child$end
341341

342342
# map to x,y coordinates
343-
child$x <- node$x + child$r * sin(child$angle)
344-
child$y <- node$y + child$r * cos(child$angle)
343+
child$x <- node$x + (child$r-node$r) * sin(child$angle)
344+
child$y <- node$y + (child$r-node$r) * cos(child$angle)
345345

346346
# save to data frame
347347
pd$nodes[i, ] <- child
-10.9 KB
Loading
-161 KB
Loading
-124 KB
Loading
-53.6 KB
Loading
-7.53 KB
Loading
-7.37 KB
Loading
-25 KB
Loading
-55.5 KB
Loading
-11.6 KB
Loading
-18 KB
Loading

vignettes/ggfree-trees.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ Let’s try to match up family names:
348348
index <- match(bird.families$tip.label, birds$Family)
349349
# some family names failed to match
350350
bird.families$tip.label[is.na(index)]
351-
#> [1] "Dendrocygnidae" "Bucorvidae" "Rhinopomastidae" "Dacelonidae"
352-
#> [5] "Cerylidae" "Centropidae" "Coccyzidae" "Crotophagidae"
353-
#> [9] "Neomorphidae" "Batrachostomidae" "Eurostopodidae" "Chionididae"
351+
#> [1] "Dendrocygnidae" "Bucorvidae" "Rhinopomastidae"
352+
#> [4] "Dacelonidae" "Cerylidae" "Centropidae"
353+
#> [7] "Coccyzidae" "Crotophagidae" "Neomorphidae"
354+
#> [10] "Batrachostomidae" "Eurostopodidae" "Chionididae"
354355
#> [13] "Eopsaltriidae"
355356
# There's only 13 of these missing, so I'm willing to manually restore them.
356357
# I *think* Dacelonidae is the tree kingfishers subfamily...
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)