artpoon / ggfree Goto Github PK
View Code? Open in Web Editor NEWggplot2-style plots with base R graphics
License: GNU General Public License v3.0
ggplot2-style plots with base R graphics
License: GNU General Public License v3.0
credit: Norm Matloff for pointing this out
however, the MASS
library already has an implementation of parallel coordinates via parcoord
- worth the effort?
Setting step
to zero should cause all ridges to be plotted at the same level (relative to vertical axis). Instead we get an error:
Error in axis(side = 2, at = seq(step, n * step, step), labels = labels, :
'at' and 'labels' lengths differ, 1 != 4
@ArtPoon. I was trying to download the ggfree package and i got this error saying a file may be corrupted..
Downloading GitHub repo ArtPoon/ggfree@master
✔ checking for file ‘/tmp/RtmpifOPql/remotes28c9121cd011/ArtPoon-ggfree-a77c6b3/DESCRIPTION’ ...
─ preparing ‘ggfree’:
✔ checking DESCRIPTION meta-information ...
Warning: /tmp/RtmplDOCZk/Rbuild31261b3e9c2a/ggfree/man/plot.phyloLayout.Rd:46: unexpected TEXT ' ', expecting '{'
Warning: /tmp/RtmplDOCZk/Rbuild31261b3e9c2a/ggfree/man/tree.layout.Rd:13: unexpected TEXT ' ', expecting '{'
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ looking to see if a ‘data/datalist’ file should be added
─ building ‘ggfree_0.1.0.tar.gz’
Installing package into ‘/home/abayomi/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
* installing *source* package ‘ggfree’ ...
** R
** data
*** moving datasets to lazyload DB
Warning: file ‘StJohns.RData’ has magic number 'RDX3'
Use of save versions prior to 2 is deprecated
Error in load(zfile, envir = envir) :
bad restore file magic number (file may be corrupted) -- no data loaded
ERROR: lazydata failed for package ‘ggfree’
* removing ‘/home/abayomi/R/x86_64-pc-linux-gnu-library/3.4/ggfree’
Error: Failed to install 'ggfree' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpifOPql/file28c92e2d4e6b/ggfree_0.1.0.tar.gz’ had non-zero exit status
Issue raised by user, need to confirm
> require(ggfree)
> stackplot(cbc[2:n])
> stackplot(cbc[2:n], type='w')
> head(cbc)
year American.Crow Canada.Goose Common.Goldeneye Common.Merganser
1 1960 3.393258 0.005617978 1.9494382 6.741573
2 1961 6.278027 0.000000000 0.3811659 26.905830
3 1962 2.590674 0.000000000 0.5699482 7.772021
4 1963 5.633803 0.000000000 1.0328638 23.474178
5 1964 8.823529 0.053921569 0.4901961 25.000000
6 1965 15.189873 0.000000000 1.1392405 4.493671
European.Starling Greater.Scaup Herring.Gull House.Sparrow
1 7.303371 0.30337079 56.179775 18.53933
2 14.798206 0.11659193 53.811659 15.24664
3 21.761658 0.27461140 22.279793 10.36269
4 19.248826 0.35211268 14.553991 13.61502
5 20.588235 0.14705882 7.843137 14.70588
6 23.417722 0.05696203 7.594937 15.82278
Long.tailed.Duck Mallard
1 0.81460674 1.0898876
2 0.04932735 1.2107623
3 0.16580311 1.0362694
4 2.58215962 1.1267606
5 0.27941176 0.9803922
6 0.10759494 2.7848101
> tail(cbc)
year American.Crow Canada.Goose Common.Goldeneye Common.Merganser
53 2012 2.544333 31.24647 5.864816 4.2508353
54 2013 2.585071 30.98793 3.408342 2.7497256
55 2014 4.284519 26.48257 7.609484 6.0195258
56 2015 3.085973 20.68326 7.013575 0.8642534
57 2016 3.027925 16.12739 9.665359 2.6171244
58 2017 1.997484 33.53459 10.968553 0.8201258
European.Starling Greater.Scaup Herring.Gull House.Sparrow
53 11.51375 10.573117 4.718581 7.571318
54 73.62239 6.344676 12.749726 9.890231
55 46.53835 19.129707 12.686192 7.352859
56 24.33032 9.398190 1.936652 10.524887
57 19.42765 13.270252 3.803369 11.839372
58 14.30943 6.933333 1.569811 13.740881
Long.tailed.Duck Mallard
53 1.922385 26.99049
54 22.557629 24.28650
55 28.535565 15.49233
56 10.438914 13.06787
57 20.816986 15.99815
58 17.433962 25.32830
Currently we are using an arbitrary numeric index to arrange densities along the y-axis. This causes problems if the labels are numeric, e.g., progressively increasing years.
See ggsunburst
Throws the following error:
Error in axis(side = 2, at = seq(step, n * step, step), labels = labels, :
'at' and 'labels' lengths differ, 1 != 3
Attempting to color branches in very large tree:
> # all sequences
> phy <- read.tree("~/git/flu/data/removeX.ft2.nwk")
> phy <- midpoint(phy)
> phy <- ladderize(phy)
> pal <- gg.rainbow(18)
> # it takes a couple of minutes to generate this layout
> L <- tree.layout(phy)
> res <- 300
> png("~/git/flu/test.png", width=5*res, height=8*res, res=res)
> plot(L, label='n')
> for (i in 1:18) {
+ print(i)
+ # note phy$tip.label == L2$nodes$label[1:Ntip(phy)]
+ idx <- which(grepl(paste("\\(H", i, "[N)]", sep=""), phy$tip.label))
+ draw.clade(L, tips=phy$tip.label[idx], col=pal[i])
+ # label clades using tip farthest from origin
+ #last.tip <- idx[which.max(L2$nodes$r[idx])]
+ }
[1] 1
Error in obj$edges$y0[parents] : invalid subscript type 'list'
Need to save user's mar
settings and then restore after plot.
Here, phy
is a tree that I simulated with twt
, which annotates the S3 object with additional node and edge features. Unrooting the tree removes the root node and one edge, such that these additional features have the wrong length:
> pd <- as.phyloData(phy, unscaled)
Warning messages:
1: In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute event.type of length 135
2: In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute compartment1 of length 135
3: In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute compartment2 of length 135
4: In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute type1 of length 135
5: In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute type2 of length 135
Proposed solution, overwrite unroot
that is imported from the ape
package.
This would be really nice to have...
Hi there,
Thank you for this, your code is amazing - I've been trying to use ggtree and have found the documentation really poor, for my particular task.
I'm trying to decorate a bird phylogeny (made with birdtree.org), and I'd like to decorate with another variable. My variable is the accuracy per species in an identification test, which I'd like to show with the phylogeny.
print(acc)
[1] 0.9277778 0.9438059 0.9272353 0.8306878 0.8876118 0.9082126 0.9476373 0.9053498 0.9333333
[10] 0.9449735 0.9487179 0.9656085 0.9317739 0.9272353 0.9444444 0.9225589 0.9382716 0.9469136
[19] 0.9583333
As you can see, it's not an integer. This was the code I used
`require(devtools)
devtools::install_github("ArtPoon/ggfree")
library(ggfree)
require(RColorBrewer)
L <- tree.layout(bird_tree, type='o')
plot(L, cex.lab=0.7, offset=2, mar=rep(5,4), col='chocolate')
image(L, z=as.matrix(acc), xlim=c(28.5,30), col=pal)`
However, the variable is misplaced inside the actual phylogeny
Running R CMD check .
raises 1 error, 9 warnings and 5 notes:
* using log directory ‘/home/art/git/ggfree/..Rcheck’
* using R version 3.6.1 (2019-07-05)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘./DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘ggfree’ version ‘0.1’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
vignettes/.gitignore
..Rcheck
.git
These were most likely included in error. See section ‘Package
structure’ in the ‘Writing R Extensions’ manual.
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘ggfree’ can be installed ... WARNING
Found the following significant warnings:
Warning: /home/art/git/ggfree/man/plot.phyloLayout.Rd:45: unexpected TEXT ' ', expecting '{'
Warning: /home/art/git/ggfree/man/tree.layout.Rd:13: unexpected TEXT ' ', expecting '{'
See ‘/home/art/git/ggfree/..Rcheck/00install.out’ for details.
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... NOTE
Checking should be performed on sources prepared by ‘R CMD build’.
* checking top-level files ... NOTE
File
LICENSE
is not mentioned in the DESCRIPTION file.
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... WARNING
Found the following directory with the name of a check directory:
./..Rcheck
Most likely, these were included erroneously.
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... NOTE
Package in Depends field not imported from: ‘ape’
These packages need to be imported from (in the NAMESPACE file)
for when this namespace is loaded but not attached.
* checking S3 generic/method consistency ... WARNING
print:
function(x, ...)
print.phyloData:
function(obj)
print:
function(x, ...)
print.phyloLayout:
function(obj)
image:
function(x, ...)
image.phyloLayout:
function(obj, z, xlim, col, border, xaxt, ...)
lines:
function(x, ...)
lines.phyloLayout:
function(obj, col, shade, ...)
plot:
function(x, ...)
plot.phyloLayout:
function(obj, type, col, lwd, label, cex.lab, mar, ...)
points:
function(x, ...)
points.phyloLayout:
function(obj, ...)
text:
function(x, ...)
text.phyloLayout:
function(obj, label, align, cex.lab, offset, ...)
See section ‘Generic functions and methods’ in the ‘Writing R
Extensions’ manual.
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... NOTE
.layout.equalangle: no visible global function definition for
‘is.rooted’
.layout.equalangle: no visible global function definition for ‘Nnode’
.layout.radial: no visible global function definition for ‘Ntip’
.layout.rect: no visible global function definition for ‘Ntip’
.layout.rect: no visible global function definition for ‘postorder’
add.alpha : <anonymous>: no visible global function definition for
‘col2rgb’
add.alpha : <anonymous>: no visible global function definition for
‘rgb’
add.grid: no visible global function definition for ‘par’
add.grid: no visible global function definition for ‘rect’
add.grid: no visible global function definition for ‘abline’
add.grid: no visible global function definition for ‘box’
add.scalebar: no visible global function definition for ‘segments’
add.scalebar: no visible global function definition for ‘text’
as.phyloData: no visible global function definition for ‘Nnode’
as.phyloData: no visible global function definition for ‘Ntip’
as.phyloData: no visible global function definition for ‘subtrees’
as.phyloData: no visible binding for global variable ‘Ntip’
as.phyloData: no visible global function definition for ‘node.depth’
as.phyloData: no visible global function definition for
‘node.depth.edgelength’
blend.colors: no visible global function definition for ‘col2rgb’
blend.colors: no visible global function definition for ‘rgb’
draw.arc: no visible global function definition for ‘lines’
draw.arc: no visible global function definition for ‘polygon’
draw.guidelines: no visible global function definition for ‘segments’
image.phyloLayout: no visible global function definition for
‘colorRampPalette’
image.phyloLayout: no visible global function definition for ‘par’
image.phyloLayout: no visible global function definition for ‘rect’
image.phyloLayout: no visible global function definition for ‘axis’
image.phyloLayout: no visible binding for global variable ‘geno’
lines.phyloLayout: no visible global function definition for ‘segments’
plot.phyloLayout: no visible global function definition for ‘par’
plot.phyloLayout: no visible global function definition for ‘plot’
plot.phyloLayout: no visible global function definition for ‘lines’
points.phyloLayout: no visible global function definition for ‘points’
polarplot: no visible global function definition for ‘plot’
polarplot: no visible binding for global variable ‘text’
print.phyloData: no visible global function definition for ‘str’
print.phyloData: no visible global function definition for ‘head’
print.phyloLayout: no visible global function definition for ‘head’
ridgeplot: no visible global function definition for ‘plot’
ridgeplot: no visible global function definition for ‘axis’
ridgeplot: no visible global function definition for ‘polygon’
ridgeplot: no visible global function definition for ‘lines’
ridgeplot: no visible global function definition for ‘segments’
ringplot: no visible global function definition for ‘par’
ringplot: no visible global function definition for ‘plot’
ringplot: no visible global function definition for ‘text’
slopegraph: no visible global function definition for ‘par’
slopegraph: no visible global function definition for ‘plot’
slopegraph: no visible global function definition for ‘axis’
slopegraph: no visible global function definition for ‘text’
slopegraph : <anonymous>: no visible global function definition for
‘lines’
slopegraph : <anonymous>: no visible global function definition for
‘text’
text.phyloLayout: no visible global function definition for ‘par’
text.phyloLayout: no visible global function definition for ‘text’
unroot: no visible global function definition for ‘is.rooted’
unroot: no visible global function definition for ‘Ntip’
unroot: no visible global function definition for ‘Nnode’
unroot: no visible global function definition for ‘unroot.phylo’
Undefined global functions or variables:
Nnode Ntip abline axis box col2rgb colorRampPalette geno head
is.rooted lines node.depth node.depth.edgelength par plot points
polygon postorder rect rgb segments str subtrees text unroot.phylo
Consider adding
importFrom("grDevices", "col2rgb", "colorRampPalette", "rgb")
importFrom("graphics", "abline", "axis", "box", "lines", "par", "plot",
"points", "polygon", "rect", "segments", "text")
importFrom("utils", "head", "str")
to your NAMESPACE file.
* checking Rd files ... WARNING
prepare_Rd: man/plot.phyloLayout.Rd:45: unexpected TEXT ' ', expecting '{'
prepare_Rd: man/tree.layout.Rd:13: unexpected TEXT ' ', expecting '{'
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... WARNING
Undocumented code objects:
‘flu’ ‘structSI’
Undocumented data sets:
‘flu’ ‘structSI’
All user-level objects in a package should have documentation entries.
See chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'add.alpha'
‘col’ ‘alpha’
Documented arguments not in \usage in documentation object 'add.alpha':
‘col:’ ‘alpha:’
Undocumented arguments in documentation object 'add.grid'
‘mode’ ‘fg.col’ ‘bg.col’ ‘lwd.major’ ‘lwd.minor’ ‘bty’
Documented arguments not in \usage in documentation object 'add.grid':
‘mode:’ ‘fg.col:’ ‘bg.col:’ ‘lwd.major:’ ‘lwd.minor:’
Undocumented arguments in documentation object 'add.scalebar'
‘obj’ ‘len’ ‘x0’ ‘y0’ ‘lwd’ ‘...’
Documented arguments not in \usage in documentation object 'add.scalebar':
‘obj:’ ‘len:’ ‘x0:’ ‘y0:’ ‘...:’
Undocumented arguments in documentation object 'as.phyloData'
‘phy’ ‘unscaled’
Documented arguments not in \usage in documentation object 'as.phyloData':
‘phy:’
Undocumented arguments in documentation object 'blend.colors'
‘col’
Documented arguments not in \usage in documentation object 'blend.colors':
‘col:’
Undocumented arguments in documentation object '.layout.equalangle'
‘phy’ ‘unscaled’
Undocumented arguments in documentation object 'draw.arc'
‘x’ ‘y’ ‘theta0’ ‘theta1’ ‘r0’ ‘r1’ ‘n’ ‘...’
Documented arguments not in \usage in documentation object 'draw.arc':
‘x:’ ‘y:’ ‘theta0:’ ‘theta1:’ ‘r0:’ ‘r1:’ ‘n:’
Undocumented arguments in documentation object 'draw.guidelines'
‘obj’ ‘lty’ ‘...’
Documented arguments not in \usage in documentation object 'draw.guidelines':
‘obj:’ ‘lty:’ ‘...:’
Undocumented arguments in documentation object 'image.phyloLayout'
‘obj’ ‘z’ ‘xlim’ ‘col’ ‘border’ ‘xaxt’ ‘...’
Documented arguments not in \usage in documentation object 'image.phyloLayout':
‘obj:’ ‘z:’ ‘xlim:’ ‘col:’ ‘border:’ ‘xaxt:’
Undocumented arguments in documentation object 'lines.phyloLayout'
‘obj’ ‘col’ ‘shade’ ‘...’
Documented arguments not in \usage in documentation object 'lines.phyloLayout':
‘obj:’ ‘col:’ ‘shade:’ ‘...:’
Undocumented arguments in documentation object 'plot.phyloLayout'
‘obj’ ‘type’ ‘col’ ‘lwd’ ‘label’ ‘cex.lab’ ‘mar’ ‘...’
Documented arguments not in \usage in documentation object 'plot.phyloLayout':
‘obj:’ ‘type:’ ‘col:’ ‘lwd:’ ‘label:’ ‘cex.lab:’ ‘mar:’ ‘...:’
Undocumented arguments in documentation object 'points.phyloLayout'
‘obj’ ‘...’
Documented arguments not in \usage in documentation object 'points.phyloLayout':
‘obj:’ ‘...:’
Undocumented arguments in documentation object 'polarplot'
‘obj’ ‘x’ ‘y’ ‘r’ ‘theta’ ‘space’ ‘col’ ‘use.names’ ‘pad.names’
‘cex.names’ ‘...’
Documented arguments not in \usage in documentation object 'polarplot':
‘obj:’ ‘r:’ ‘theta:’ ‘space:’ ‘col:’ ‘use.names:’ ‘pad.names:’
‘cex.names:’ ‘...:’
Undocumented arguments in documentation object 'print.phyloData'
‘obj’
Documented arguments not in \usage in documentation object 'print.phyloData':
‘obj:’
Undocumented arguments in documentation object 'print.phyloLayout'
‘obj’
Documented arguments not in \usage in documentation object 'print.phyloLayout':
‘obj:’
Undocumented arguments in documentation object 'ridgeplot'
‘x’ ‘xlim’ ‘labels’ ‘yaxt’ ‘xlab’ ‘ylab’ ‘step’ ‘col’ ‘fill’ ‘lwd’
‘density.args’ ‘add.grid’ ‘grid.args’ ‘extend.lines’ ‘add’ ‘...’
Documented arguments not in \usage in documentation object 'ridgeplot':
‘x:’ ‘xlim:’ ‘labels:’ ‘xlab:’ ‘ylab:’ ‘step:’ ‘col:’ ‘fill:’ ‘lwd:’
‘density.args:’ ‘add.grid:’ ‘grid.args:’ ‘extend.lines:’ ‘add:’
‘...:’
Undocumented arguments in documentation object 'ringplot'
‘vec’ ‘r0’ ‘r1’ ‘theta’ ‘x’ ‘y’ ‘col’ ‘use.names’ ‘offset’ ‘srt’
‘cex.label’ ‘...’
Documented arguments not in \usage in documentation object 'ringplot':
‘vec:’ ‘r0:’ ‘r1:’ ‘theta:’ ‘x:’ ‘y:’ ‘col:’ ‘use.names:’ ‘offset:’
‘srt:’ ‘cex.label:’ ‘...:’
Undocumented arguments in documentation object 'slopegraph'
‘x’ ‘y’ ‘type’ ‘names.arg’ ‘xlab’ ‘ylab’ ‘colorize’ ‘pal’ ‘shim’
‘cex.text’ ‘...’
Documented arguments not in \usage in documentation object 'slopegraph':
‘x:’ ‘y:’ ‘type:’ ‘names.arg:’ ‘xlab:’ ‘ylab:’ ‘colorize:’ ‘pal:’
‘shim:’ ‘cex.text:’ ‘...:’
Undocumented arguments in documentation object 'text.phyloLayout'
‘obj’ ‘label’ ‘align’ ‘cex.lab’ ‘offset’ ‘...’
Documented arguments not in \usage in documentation object 'text.phyloLayout':
‘obj:’ ‘label:’ ‘align:’ ‘cex.lab:’ ‘...:’
Undocumented arguments in documentation object 'tree.layout'
‘phy’ ‘type’ ‘unscaled’
Documented arguments not in \usage in documentation object 'tree.layout':
‘phy:’ ‘type:’ ‘unscaled:’
Undocumented arguments in documentation object 'unroot'
‘obj’
Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... WARNING
'library' or 'require' calls not declared from:
‘HistData’ ‘RColorBrewer’
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking files in ‘vignettes’ ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
‘ggfree-trees.Rmd’, ‘ggfree-trees.md’,
‘man/figures/README-unnamed-chunk-10-1.png’,
‘man/figures/README-unnamed-chunk-10-2.png’,
‘man/figures/README-unnamed-chunk-11-1.png’,
‘man/figures/README-unnamed-chunk-14-1.png’,
‘man/figures/README-unnamed-chunk-14-2.png’,
‘man/figures/README-unnamed-chunk-14-3.png’,
‘man/figures/README-unnamed-chunk-2-1.png’,
‘man/figures/README-unnamed-chunk-4-1.png’,
‘man/figures/README-unnamed-chunk-5-1.png’,
‘man/figures/README-unnamed-chunk-7-1.png’,
‘man/figures/README-unnamed-chunk-8-1.png’,
‘man/figures/README-unnamed-chunk-9-1.png’
* checking examples ... ERROR
Running examples in ‘ggfree-Ex.R’ failed
The error most likely occurred in:
> ### Name: plot.phyloLayout
> ### Title: plot.phyloLayout
> ### Aliases: plot.phyloLayout
>
> ### ** Examples
>
> # generate random coalescent tree
> set.seed(1999); phy <- rcoal(50)
>
> # rectangular tree
> plot(tree.layout(phy, type='r'), mar=c(3,0,0,1))
> axis(side=1)
>
> # unscaled slanted tree with colors
> pal <- colorRampPalette(c('cadetblue', 'brown'))
> plot(tree.layout(phy, type='s', unscaled=T), col=pal(5))
Error in as.phyloData(phy, unscaled) : T used instead of TRUE
Calls: plot -> tree.layout -> .layout.rect -> as.phyloData
Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... WARNING
dir.exists(dir) is not TRUE
Package vignette without corresponding single PDF/HTML:
‘ggfree-trees.Rmd’
* checking running R code from vignettes ... NONE
‘ggfree-trees.Rmd’using ‘UTF-8’... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR, 9 WARNINGs, 5 NOTEs
Should be fairly straight-forward - these seem to be translucent polygons over a radial layout (which is in itself a weird mix of coordinate systems).
art@Kestrel:~/git/ggfree$ R CMD INSTALL .
* installing to library ‘/home/art/R/x86_64-pc-linux-gnu-library/3.6’
* installing *source* package ‘ggfree’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
Warning: file ‘co2.RData’ has magic number 'X'
Use of save versions prior to 2 is deprecated
Error in load(zfile, envir = tmp_env) :
bad restore file magic number (file may be corrupted) -- no data loaded
ERROR: lazydata failed for package ‘ggfree’
* removing ‘/home/art/R/x86_64-pc-linux-gnu-library/3.6/ggfree’
* restoring previous ‘/home/art/R/x86_64-pc-linux-gnu-library/3.6/ggfree’
I've run into this problem before working with different versions of R (RData version 2 is deprecated post 3.5) but in this case it is all local (same versoin of R, 3.6.1).
> mod <- MODEL$new(settings)
Error in matrix(nrow = length(pieces), ncol = 6, dimnames = list(1:length(pieces), :
length of 'dimnames' [1] not equal to array extent
Here the settings
came from a YAML with no pieces
entry
> njtree <- midpoint(njtree)
> L <- tree.layout(njtree, type='o')
> plot(L, label='n')
Error in plot.window(...) : need finite 'xlim' values
This is a tree I reconstructed from some SARS-CoV-2 genomes:
> phy <- read.tree('~/git/covizu/data/timetree.nwk')
> phy
Phylogenetic tree with 263 tips and 177 internal nodes.
Tip labels:
B.6.1, B.5, B.17, B.4, B.4.1, B.4.2, ...
Node labels:
NODE_0000002, NODE_0000215, NODE_0000216, NODE_0000217, NODE_0000222, NODE_0000223, ...
Rooted; includes branch lengths.
This works fine for unrooted tree layout:
> tips <- c("B.5", 'B.2.1', 'B.9')
> L <- tree.layout(phy, 'u')
> plot(L)
> draw.clade(L, tips, lwd=2)
But it messes up for rect layout:
> L <- tree.layout(phy, 'r')
Warning message:
In as.phyloData(phy, unscaled) :
as.phyloData ignoring attribute root.edge of length 1
> plot(L)
> draw.clade(L, tips, lwd=2)
MRE:
require(ggfree)
set.seed(1)
phy <- rtree(50)
L <- tree.layout(phy)
col <- ifelse(grepl("t1", L$nodes$label), 'red', 'blue')
plot(L, label='n')
text(L, align=F, col=col, cex=0.8)
L2 <- tree.layout(phy, type='o')
col <- ifelse(grepl("t1", L2$nodes$label), 'red', 'blue')
plot(L2, label='n')
text(L2, align=F, col=col, cex=0.8)
Reported by @veratai
For R packages authored and maintained by others that provide nice viz options without ggplot2, e.g., beeswarm.
Something's wrong with the equal layout algorithm.
When unscaled=FALSE
(default), the branch lengths should be unaffected (mapping x
from rectangular layout directly to radius parameter r
).
However, it doesn't look like this is getting handled correctly.
> ridgeplot(rnorm(100))
Error in ridgeplot(rnorm(100)) :
Unsupported class of argument x (must be list)
Expected response: generate a ridgeplot with a single density.
> slopegraph(t(df[1:2, taxa]), names.arg=c('sample1', 'sample2'), log='y')
There were 12 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: In plot.xy(xy.coords(x, y), type = type, ...) :
"log" is not a graphical parameter
2: In plot.xy(xy.coords(x, y), type = type, ...) :
"log" is not a graphical parameter
Came across this when attempting to add a second series of densities to the current plot - one of the entries in the list did not exist.
Possible strategies:
NA
as placeholder - problem density
doesn't like missing (non-numeric) values.Need to detect the dimensions of the plot device before specifying the xlim and ylim ranges
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.