Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paintBranches error when sapply within function returns ii as list #130

Open
rubysaltbush opened this issue Mar 15, 2023 · 1 comment
Open

Comments

@rubysaltbush
Copy link

Hello!

I am trying to use paintBranches on a large (1201 tip) phylogeny and it gave the error:

Error in tree$edge.length[[ii[i]]] : invalid subscript type 'list'

For some reason in Line 8 of the paintBranches function sapply is returning a list with my data, although running the example code from your blog it returns a vector.

I've fixed this by defining the function in my code and adding ii <- unlist(ii) at Line 9 of the paintBranches function, not sure if you could add this fix to the function to prevent it happening for others in future?

@liamrevell
Copy link
Owner

Hi @rubysaltbush. To figure this out I'd really need to see a reproducible example, as I'm not running into the same problem using example cases -- even with trees of similar size. Thanks! -- Liam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants