Seems for that approch M should me a matrix (which I bet it actually is in 
this case) 
not a data frame. 

I wonder about the following, if you will forgive a slight digression:
It seems for really large matrices there could be a speedup as well as
savings of memory with something like.

M <- (M>0)     # logical, or 
M <- (M>0)*1L  # integer 01

Whether it would make a practical difference would be another thing. 
You can look at sizes of objects with object.size().
regards,
David 


r-sig-ecology-bounces@r-project.org wrote on 02/12/2013 04:19:09 PM:

> From: MARCELINO DE LA CRUZ ROT <marcelino.delacruz@upm.es>
> To: <r-sig-ecology@r-project.org>
> Date: 02/12/2013 04:20 PM
> Subject: Re: [R-sig-eco] How do I convert a matrix from abundant 
> into presence/absence data?
> Sent by: r-sig-ecology-bounces@r-project.org
> 
> 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@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 
> -- 
> MARCELINO DE LA CRUZ ROT
> Universidad Politecnica de Madrid
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

	[[alternative HTML version deleted]]

