When a column called "sample_name" is present in the sample table, plotting a stack plot fails (produces a single stack called "NA" instead of one per sample).
Code that produces the error (tidytacos v1.0.0, R v4.3.2):
library(tidyverse)
library(tidytacos)
# read data
data <- read_rds("tacoplot_bug.rds")
# this fails (only one stack called "NA")
data %>% tacoplot_stack()
# this fixes the problem!
data$samples$sample_name <- NULL
data %>% tacoplot_stack()
I'm pretty sure it has to do with one of the counts_matrix function (or a similar one) using the "sample_name" column as rownames for the count matrix instead of the "sample_id" column.
When a column called "sample_name" is present in the sample table, plotting a stack plot fails (produces a single stack called "NA" instead of one per sample).
Code that produces the error (tidytacos v1.0.0, R v4.3.2):
I'm pretty sure it has to do with one of the counts_matrix function (or a similar one) using the "sample_name" column as rownames for the count matrix instead of the "sample_id" column.
The dataset: tacoplot_bug.zip