microeco icon indicating copy to clipboard operation
microeco copied to clipboard

How to handle missing values (NA) in RDA?

Open amrvx4 opened this issue 2 years ago • 1 comments

Dear Chi Liu, first of all thank you very much for such a comprehensive package. I have been using this package extensively for my metagenomic analysis

When I tried to run RDA analysis, I get this error

` KIN_bac_exp_1$cal_rda(use_dbrda = TRUE, use_measure = "bray")
Error in na.fail.default(list(BG = c(8.01, 7.43, 14.56, 6.98, 5.61, 8.94,  : 
  missing values in object`

I do have NA values in some of my environmental variables (env data) I believe the RDA is based on vegan and I tried to omit NAs

`KIN_bac_exp_1$cal_rda(use_dbrda = TRUE, use_measure = "bray",na.action = na.omit)
Error in KIN_bac_exp_1$cal_rda(use_dbrda = TRUE, use_measure = "bray",  : 
  unused argument (na.action = na.omit)`

Any way to work around this ?

Thank you!

amrvx4 avatar Mar 14 '22 18:03 amrvx4

Hi, @amrvx4 Please first see the complete_na parameter in trans_env$new. If complete_na = TRUE, the function can run interpolation to fill the NA with the method in mice package. Sure another way is to filter those samples with na values. Please select the suitable way and feel free to tell me if the result is not good.

Chi

ChiLiubio avatar Mar 15 '22 13:03 ChiLiubio