[R-sig-eco] How do I convert a matrix from abundant into presence/absence data?

MARCELINO DE LA CRUZ ROT marcelino.delacruz at upm.es
Tue Feb 12 22:19:09 CET 2013


Let's say your matrix or data.frame is named M

M[M>0] <-1

Now M is only 0's and 1's

HTH,
Marcelino


El 2013-02-12 22:04, Cory Redman escribió:
> I am sure there is any easy solution to this, but due to my
> monkey-level understanding of R, I need some help and can't seem to
> find the answer to my question via the web.
>
> I have been successful in importing an abundance dataset (taxa = 
> rows,
> sample sites = columns) into R, but I want to rerun some analyses by
> converting this dataset into presence/absence data, How do I do this?
>
> Cheers,
>    Cory
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

-- 
MARCELINO DE LA CRUZ ROT
Universidad Politecnica de Madrid



More information about the R-sig-ecology mailing list