Closed lcamVz closed 3 years ago
This error message is most likely triggered by the methods
package, one of the dependencies. It supplies the as()
function used to coerce polygon coordinates into gpc.poly
objects. So much for the background although I'm not 100% sure. I can't reproduce the error because I can't detach methods
and see if that package triggers the error. You could try to update your R installation to the latest version and/or update your packages, particularly methods
.
Alternatively, if you can't install the package for some reason, you can try to use the ShinyTreemaps app which provides the same functionality but with a GUI: https://m-jahn.shinyapps.io/ShinyTreemaps/
Thank you for the quick reply. I was able to update the packages and it worked. I tried the shiny app but got an error in the app the table. Maybe is the table format I am presenting the data. I want to use this package to illustrate microbial composition from a data set I have. Any suggestions?
Good to hear that the update solved your issue with the package. For the app, try to format your table as a plain and simple *.csv
file, that means comma separated values, not tab-separated values. The following example works just fine to generate a csv
table and upload it to the app:
library(tidyverse)
df <- data.frame(col1 = letters, col2 = abs(rnorm(length(letters))))
write_csv(df, "test.csv")
Thank you! I got the package to work with my data set. Now for some reason, I have a layering issue with one of the level names. It looks like I have a dual text where I don't.
Also how I can plot columns removing the zeroes how would you manage that?
Regarding overplotting of labels, is it possible that you are plotting two levels, not just one? Like first the parent level which is all "Acidobacteria" and then the next lower level with the different subgroups. The solution here is to simply not plot the parent layer (not necessary if it's all the same group), or don't plot the label for that. You can control which labels to plot using the label_level
parameter. In your example, drawing labels for only 2nd level works like this:
drawTreemap(tm, label_level = 2)
Regarding the second question, can you be more specific about what you mean with removing zeroes? For filtering and formatting your data frame I'd suggest to look at some basic tutorials for dplyr
and tidyr
. These are popular packages to reshape your data.
Thank you for the replies! I was able to get the figures and work with the 0. Thank you again!!
I am running the tutorial and came across an error any suggestions?
I get this error:
Error in asMethod(object) : could not find function "asMethod"