[Vegan-commits] r2323 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 10 18:17:19 CEST 2012


Author: psolymos
Date: 2012-10-10 18:17:19 +0200 (Wed, 10 Oct 2012)
New Revision: 2323

Modified:
   pkg/vegan/R/clamtest.R
Log:
as.factor != factor

Modified: pkg/vegan/R/clamtest.R
===================================================================
--- pkg/vegan/R/clamtest.R	2012-10-10 08:03:28 UTC (rev 2322)
+++ pkg/vegan/R/clamtest.R	2012-10-10 16:17:19 UTC (rev 2323)
@@ -97,7 +97,7 @@
     tmp <- ifelse(cbind(gen, specY, specX, sr), 1, 0)
     types <- c("Generalist", paste("Specialist", glabel[1], sep="_"),
         paste("Specialist", glabel[2], sep="_"), "Too_rare")
-    classes <- as.factor((1:4)[rowSums(tmp*col(tmp))], levels=1:4)
+    classes <- factor((1:4)[rowSums(tmp*col(tmp))], levels=1:4)
     levels(classes) <- c("Generalist", paste("Specialist", glabel[1], sep="_"),
         paste("Specialist", glabel[2], sep="_"), "Too_rare")
     tab <- data.frame(Species=spp, y=Y, x=X, Classes=classes)



More information about the Vegan-commits mailing list