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

More general functions wanted #3

Closed
hope-data-science opened this issue Sep 27, 2021 · 5 comments
Closed

More general functions wanted #3

hope-data-science opened this issue Sep 27, 2021 · 5 comments
Assignees

Comments

@hope-data-science
Copy link

I can't believe that such an amazing package is not getting more attention than it is now. As for our general needs, I want to ask if such functions could be designed:

  1. When a data.frame with label and value is provided, can a convinient function provided to generate a figure? Or at least a single data.frame (instead of two) with enough information to plot.
  2. If I have a network, like edge list or igraph object, is there an easy way to transfer it to the circle pack in a function?

Thanks. Again, I want to show my appreciation to this awesome work.

@mbedward
Copy link
Owner

Many thanks for your kind words.

For your first suggestion, do you mean that you want to provide a label in the input data that will be carried along to the output and, perhaps, also be used by the circleVertices function?

For your second suggestion, does the circleGraphLayout function help at all? It not, can you provide a small example of what you would like to do?

Michael

@mbedward mbedward self-assigned this Sep 27, 2021
@hope-data-science
Copy link
Author

hope-data-science commented Sep 27, 2021

Thank you for the prompt feedback.

For the first suggestion, I mean the package could wrap a function so that when we have data.frame like:

data("bacteria")
head(bacteria)
##   value  colour                                label
## 1  4232 #DDF379            Dehalogenimonas sp. WBC-2
## 2  5097 #F3C679 Desulfatibacillum alkenivorans AK-01
## 3  2825 #79F398               Opitutus terrae PB90-1
## 4  3471 #F3C679                            Geobacter
## 5  7515 #79F3EA        Methanosaeta harundinacea 6Ac
## 6  2476 #C4F379  Rubinisphaera brasiliensis DSM 5305

We can reach the plot in an one-station function. Currently these functions provide us with the facilities to calculate the coordinates of the polygons and the center of them. It would be convenient if you can wrap it up and make it a function so we could get to the destination at no time (but it makes the package have more dependencies, if this is not disirable, maybe making another package could help).

For the second suggestion, I think I've found the answer in the ggraph package which makes plots like (see https://www.r-graph-gallery.com/circle-packing.html):
image
using the network data. Network data might not be accurate because it displays hierarchy in essence.

@mbedward
Copy link
Owner

Yes, the ggraph package is your friend if you need to do hierarchical packings.

If I understand your first suggestion correctly, you want to be able to go from the data frame straight to a ggplot object - is that right? Perhaps one way of doing that without adding dependencies to packcircles would be to have a second package that implements a geom_packcircles function. It seems like a nice idea!

@hope-data-science
Copy link
Author

That is exactly what I mean, and expect for the geom_packcircles to emerge in a new package or in ggplot2. And the interative feature is awesome too, hope it could be implemented in the new package or in the plotly package which supports ggplot2 as well.

@mbedward
Copy link
Owner

Closing this issue since the new ggcirclepack package is being developed.

@mbedward mbedward closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants