Hi everybody,

I'm working on a database who contains taxonomic information about Fungi. For each taxonomic rank (kingdom, division, family, genus, ecc...) I have the relative value of probability associated that indicates the probability that the observed row actually belongs to that certain rank.

I have to filter those observation who have a low value of probability but instead of removing rows, I would like to replace with NA the observation which have a low probability value.

Example:

tibble(tax_rank_one = rep("fungi", 10),

val_one = c(1, 1, 1, 0.4, 0.5, 1, 1, 1, 0.3, 0.9),

tax_rank_two = c("Basidiomycota", "Ascomycota", "Ascomycota", "Basidiomycota", "Basidiomycota", "Ascomycota", "Basidiomycota", "Ascomycota", "Ascomycota", "Ascomycota"),

val_two = c (1, 1, 1, 0.1, 0.1, 1, 0.5, 1, 0.1, 0.1))

My will is to replace with NA the observation in "tax_rank_one" corresponding to a value lower than 0.8 in "val_one" variable. And the same for "tax_rank_two" and "val_two" variables.

Thanks all of you for the help!