Skip to content

Help with ape - read.GenBank()

3 messages · Ben Bolker, James Meadow

#
James Meadow <jfmeadow <at> gmail.com> writes:
It's not entirely clear how your CSV file is structured, but I'm supposing
that you have all your accession numbers in a single row (with appropriately
matching headers).  (It would be a little bit more "R-ish" if you had
them all in a column, and would make life a little easier, but let's
work with what you have.)

After you use read.csv(), try str(x)

This should tell you that you have a data frame with a lot of columns,
each of which is a factor with a single element and a single level.
m <- as.matrix(x)

str(m) should tell you you have a 1-row matrix of type 'character'

then 

v <- c(m)

should drop the dimensions and leave you with a character vector
(try str(v) again to be sure)

then

read.GenBank(v)

should work

For future phylogenetic/comparative-methods type questions,
it's probably better to write to the r-sig-phylo mailing list ...