Questions tagged [ape-phylo]

Ape is an R package for performing phylogenetic analyses and plotting phylogenetic trees.

78 questions
0
votes
1 answer

How to use a variable to specify an output file name in R?

I'm trying to write an Rscript to run the phylogenetics package ape to run the same command on many input files and produce an output file for each one with a modified version of the original file name. Here is the code I'm trying to…
0
votes
1 answer

Can't save phylogenetic tree to pdf with color

I am trying to save my phylogenetic tree with coloured branches using discrete data, everytime I do the pdf() function and then try to open it I get a pdf error. This is the code I am using tree =…
0
votes
1 answer

Combining redundant nodes in a phylo object

I have a phylo-object, zphylo, in R which if plotted looks like this: library(phytools) plotTree(zphylo) + nodelabels() Only the nodes labelled 85 and 56 are informative for the phylogenic structure. The other nodes get in the way and I'd like to…
Sigurgeir
  • 365
  • 2
  • 12
0
votes
1 answer

Setting the edge.lenth in a phylo object using a variable in a data.frame

I want to set the "edge.length" in a phylo object using a variable in a data.frame. The "node.label" "tip.label" in the phylo object corresponds to the rownames in the data.frame. How can edge.length be set using a variable in the data.frame while…
0
votes
1 answer

rename phylo tip labels

I want to give a species a new name in my tree of class phylo (using the ape package). I tried: tree$tip.label["speciesX"] <- "speciesY" This did not do what I wanted. Any suggestions?
user4400727
0
votes
1 answer

How are proportions of clades and proportions of bipartitions calculated in `ape`?

Consider the following dataset: fictional.df <- data.frame(L1 = c(0,0,0,0,0,0,0,0), L2 = c(0,1,0,0,0,1,1,0), L3 = c(1,1,0,1,1,1,1,1), L4=c(0,0,1,1,0,0,0,0)) I converted this to…
0
votes
1 answer

Plotting Traits on a Phylogeny

I am following this guide on how to plot traits onto a phylogeny to determine trait conservatism. I have followed it step by step but can't seem to get either the community composition or trait plots on phylogeny to work at all for my datasets. I…
Justin Luong
  • 31
  • 1
  • 11
0
votes
1 answer

I want to be able to manipulate objects in class 'phylo' - ie. round/ turn my bootstrap values from decimals (.998) into percentages (99%)

I am using RStudio, programs ape and phytools. I've generated a tree with 500 bootstrap replicates stored in an object of class phylo. Where cw is the name of my tree, I've tried the following: round(cw, digits = 2) and I get the following error…
0
votes
1 answer

ape package - print generated tree

I am using the ape package in R to generate phylogenetic trees. I would like to print out the generated tree in a png format so I can pipe the image to a website. I cannot seem to find the commands to print out the generated tree (if this is…
Slippy
  • 33
  • 6
0
votes
2 answers

Skipping slow tasks in a loop in R

I'm trying to run a simulation in R where I make a whole bunch of phylogenetic trees. The tree simulation is a bit of a problem because its run time is highly variable, sometimes 0.005 seconds and sometimes minutes. I want to avoid the slow trees so…
Greg Owens
  • 15
  • 1
  • 4
0
votes
1 answer

How to draw dendrogram using ape package in R?

I have a distance matrix of ~200 x 200 size I an unable to plot a dendrogram using the BioNJ option of ape library in R The size is big to make the plot visible What ways can I improve the visibility
0
votes
2 answers

How to create Newick tree format from raw morphology data in R on Mac OSX

I'm trying to teach myself how to do phylogenetics for historical linguistics in R. I've found a public data set (https://www.cs.rice.edu/~nakhleh/CPHL/IEDATA_112603), and I want to get a Newick format tree from it, so that I can visualize it…
John Lynch
  • 75
  • 1
  • 1
  • 9
0
votes
1 answer

subtrees() in R ape package - how are internal nodes labeled in subtree?

I'm working with the ape package in R. I want a list of every possible subtree from a phylogenetic tree. I then want to iterate through the list of subtrees and get the root of every subtree. My question is, is the first internal node listed for…
0
votes
0 answers

Error in "birthdeath" function (phylogenetic tree analysis)

I want to determine birth and death rate of a given phylogenetic tree using birthdeath of the ape package, and I get the following error: birthdeath(phy) Error in solve.default(out$hessian) : Lapack routine dgesv: system is exactly singular:…
Robert
  • 1
  • 2
0
votes
2 answers

Loop or Vectorize this function for Phylogenetic Tree Clade Dropping

I have a process which I would like to repeat a known number of times, but with a catch. The first iteration should be with the original dataset, then the next should be with the result of the first, the next with the result of the second,…
branch.lizard
  • 595
  • 1
  • 5
  • 15