How do you set factors in the mStat object? #14
-
Hi, I imported a phyloseq object using mStat_convert_phyloseq_to_data_obj. I lost the factors I had in the phyloseq object. How do I set up factors in the order I need in the new MicrobiomeStat object? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @RachBioHaz , Thank you for reaching out. It seems that you want to retain or set up factors in a specific order in the
# Assuming 'sex' is the metadata column you want to set as a factor in a specific order
peerj32.obj$meta.dat$sex <- factor(as.factor(peerj32.obj$meta.dat$sex), levels = c("male", "female"))
print(peerj32.obj$meta.dat$sex) The output will display the data in the specified factor order. Remember to replace I hope this helps. Let me know if you have any further questions! |
Beta Was this translation helpful? Give feedback.
Hi @RachBioHaz ,
Thank you for reaching out. It seems that you want to retain or set up factors in a specific order in the
MicrobiomeStat
object after importing from aphyloseq
object. Here's how you can achieve this:phyloseq
object to aMicrobiomeStat
object usingmStat_convert_phyloseq_to_data_obj
, you'll get an object similar topeerj32.obj
.