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

Can not find function getsubtree #620

Open
8 tasks
ShangLiii opened this issue Jul 5, 2024 · 2 comments
Open
8 tasks

Can not find function getsubtree #620

ShangLiii opened this issue Jul 5, 2024 · 2 comments

Comments

@ShangLiii
Copy link

Hi,
I am using the most updated ggtree.
When I tried to zoom in to specific clade using getsubtree, it is said the function not found.
I am wondering whether there is any requirement I missed using installation.
image
Thanks!

Prerequisites

  • Have you read Feedback and follow the guide?
    • make sure your are using the latest release version
    • read the documents
    • google your question/issue

Describe you issue

  • Make a reproducible example (e.g. 1)
  • your code should contain comments to describe the problem (e.g. what expected and actually happened?)

Ask in right place

  • for bugs or feature requests, post here (github issue)
  • for questions, please post to google group
@ShangLiii
Copy link
Author

In addition,
I also tried to do this:
image
It seems the function is there but I cannot use it.

@yasche
Copy link

yasche commented Sep 10, 2024

The problem is that getSubtree() is not an exported function so you normally can't access it:

> getAnywhere(getSubtree)
A single object matching ‘getSubtree’ was found
It was found in the following places
  namespace:ggtree
with value

function (tree, node) 
{
    tidytree::offspring(tree, node, self_include = TRUE)
}
<bytecode: 0x000001a5d83b20c0>
<environment: namespace:ggtree>

One way to use it anyways would be:

> ggtree:::getSubtree()

Alternatively, you could also use the offspring() function from the tidytree package with self_include = TRUE.

You might want to have a look at #186.

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