Quick simple question, indexing list objects

2 views
Skip to first unread message

Daniel Gates

unread,
Jun 5, 2012, 6:01:16 PM6/5/12
to treevo-...@googlegroups.com
Greetings all, I was working through the doSimulation code and I had a quick simple question that I couldn't find on line or any of my R books. Is there a way to index the objects within a list (like taxon) to show specified elements. For example if taxon is a list of length 20 can I use something like taxon[[1:5]] to see elements 1-5 in the list, especially in the capacity of states(taxon[[1:5]]) to get just a list of the states of elements 1-5 in the list "taxon"?

Let me know if this makes sense to you,

Cheers!
-Dan

Daniel Gates

unread,
Jun 5, 2012, 6:08:10 PM6/5/12
to treevo-...@googlegroups.com
Ok I just figured that out how to index the list, it was much simpler than I expected, I may have more questions regarding S4 indexing later though!

Thanks!
-Dan
Reply all
Reply to author
Forward
0 new messages