my program iterates through column variables in a dataframe and plots them. It uses the ggtree library to plot them. The code (simplified) that I believe is the culprit is:
for (col in cols) {
p <- p + geom_fruit(geom=geom_tile, mapping=aes(fill=get(col)), width=0.002, offset=0.05) + # ISSUE WITH fill = STRAIN
scale_fill_manual(values=col_vector, name=col)
}
I don't think its an issue with ggtree, but I believe its got to do with get(col). I believe that get column is getting overwritten, as the plot that results is this:
As you can see from the plot, the 2 columns that I am plotting are exactly the same. Plotting a single column once produces no issues, but I always notice that the second column plot overwrites the first column plot. Could someone offer assistance as to why that is?