You can utilize the decostand() function in the vegan package to transform matrices in many different ways. The presence-absence transformation would be
library(vegan) mydata_pa=decostand(as.matrix(mydata), method="pa")