MicrobiomeStat
MicrobiomeStat copied to clipboard
Format time.var in generate_alpha_trend_test_long() function
Dear Chen Yang,
I have a question regarding the use of the generate_alpha_trend_test_long() function. I am working on the microbiome communities of three coral species. Individual colonies of each species were monitored over a three year period. I would like to test for differences in alpha diversity across timepoints.
Here is the structure of my data object:
I have precalculated alpha diversity indices and passed them to the alpha.obj parameter:
I would like to use my column “Date_format” as time.var since it includes information on both year and month but I am not sure which format I should use. I tried to make it numeric using:
data.obj$meta.dat$Date_format<-as.numeric(data.obj$meta.dat$Date_format) Warning message: NAs introduced by coercion
All rows were replaced by NAs
I did the same using my column “m_format” just as a test. And got the following output:
My questions is thus: How should I write my year + month factor so it can be used as time.var in the generate_alpha_trend_test_long() function?
Thanks for your help! Gaëlle