Hi Elaine,

you should try to subset your data set data set and not the function data! Try:
data.pruned <- birddata[tree.pruned$tip.label, ]

Regards,
Klaus




On 4/5/13, Elaine Kuo <[email protected]> wrote:
> Hello,
>
> I am using the following code to prune a phylogeny tree of bird family.
> However, an error appeared when running the last line of the code, saying:
>
> Error in data[tree.pruned$tip.label, ] :
>   object of type 'closure' is not subsettable
>
>
> I do not understand the error message.
> Please kindly help explain and advise if any further information
> is in need to solve the issue.
>
> Thank you.
> Elaine
>
>
> Code
> library(geiger)
>
> # read data and tree
>    birddata <-read.csv("H:/birddata_family_20130405.csv", header = TRUE)
>   birdtree <- read.nexus("H:/birddata_family_20130405.nexus")
>   setwd("H:")
>
> #temp <- name.check(birdtree, birddata)
>   tree.pruned <- drop.tip(birdtree, tip=temp$Tree.not.data)
>
>   ## prune the data to include only those taxa in the pruned tree
>   data.pruned <- data[tree.pruned$tip.label, ]
>
>       [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/[email protected]/
>


-- 
Klaus Schliep
Phylogenomics Lab at the University of Vigo, Spain

_______________________________________________
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/

Reply via email to