Open jeremysutherland opened 1 year ago
This is the solution:
PHYLA <- unique(ps.rare@tax_table$phylum)
for (i in PHYLA){
ASV <- as.data.frame(ps.rare@otu_table)
TAXA <- as.data.frame(ps.rare@tax_table)
TAXA <- subset(TAXA, phylum == i)
print(dim(ASV))
ASV <- subset(ASV, rownames(ASV) %in% rownames(TAXA))
print(dim(ASV))
}
Does anyone know why this doesn't work?
This script is just for example purposes. The issue seems to be passing the "n" variable to the '=='. I've tried str(n), as.character(n), print(n). Nothing seems to do the trick.