KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
67 stars 23 forks source link

facet_by triggers group_by to use the same variable #112

Closed Kirk3gaard closed 3 years ago

Kirk3gaard commented 3 years ago

Hi

I have found that facet_by triggers group_by. I guess this is not intended. As the default should be NULL (show all samples)?

Code to reproduce the problem:

`

library(ampvis2)
data("MiDAS")
MiDAS$metadata$Group<-MiDAS$metadata$Plant
MiDASsubset <- amp_subset_samples(MiDAS, Plant %in% c("Aalborg West") & !SampleID %in% c("16SAMP-749"), minreads = 10000)

PLotting the heatmap shows many samples for this dataset

amp_heatmap(MiDASsubset)

Facet_by apparently triggers group by and returns only one column in the heatmap

amp_heatmap(MiDASsubset, facet_by = c("Plant"))

Facet_by in combination with group_by can bring the columns back.

amp_heatmap(MiDASsubset, facet_by = c("Plant"),group_by = "SampleID")
elpape commented 3 years ago

Noticed the same!

KasperSkytte commented 3 years ago

Hi

Sorry for my late response. It should now be fixed, the facets will show all samples in the particular group, and not be aggregated.