Cristabel, I don't know if this what you are after. Why don't you just use
the subset of data you are interested in.

mrpp(data=subset(spp, mhab == "b" & mhab == "nd"), grouping=mhab,
dist="bray",
permutations=1000)

or

spp1 <- subset(spp, mhab == "b" & mhab == "nd")
spp1$mhab <- factor(spp1$mhab) #to drop unused levels

mrpp(data=spp1, grouping=mhab, dist="bray",
permutations=1000)

HTH

Luciano


2010/9/24 <cristabel.duran@waldbau.uni-freiburg.de>

> Dear list,
>
> I'm performing a mrpp analysis for my data (spp), the
> grouping factor is mhab.
> mhab has five levels: "b"      "br"     "c"      "nd"
>    "nongap" "t"
>
> So, for a mrpp with factor mhab with all levels I'm doing:
> mrpp(data=spp, grouping=mhab, dist="bray",
> permutations=1000)
>

BUT now I want is to perform a mrpp with only levels "b"
> and "nd".
>
> I tried several ways without success:
> mrpp(data=spp, grouping=c(mhab=="b" & "nd") , dist="bray",
> permutations=1000)
> mrpp(data=spp, grouping=c(mhab=="b" & mhab=="nd") ,
> dist="bray", permutations=1000)
> mrpp(data=spp, grouping=levels(which(envno34$mhab== "b") &
> which(envno34$mhab== "b")), dist="bray", permutations=1000)
>
> I got this errors:
> - Error in x * w : non-numeric argument to binary operator
> - Error in levels(mhab(which(mhab == "b") & which(mhab ==
>  :
>   attempt to apply non-function
> - Error in mhab == "b" & "nd" :
>   operations are possible only for numeric, logical or
> complex types
> ...etc...etc..
>
> I think it should be possible to choose the factor levels
> which I want to work with, otherwise I should fix this
> issue from
> my species and environmental matrices.
>
> I appreciate your help!
> Thank you :-)
> Cristabel.
>
> Cristabel Durán Rangel. PhD Student.
> Institute of Silviculture. Faculty of Forest and
> Environmental Sciences. University of Freiburg.
> Germany
> Telf: +49 (761) 203 8604 (ofc)
>
> „Man lernt die Physiognomie einer Landschaft desto besser
> kennen, je genauer man die einzelnen Züge auffaßt, sie
> untereinander vergleicht und so auf dem Wege der Analysis
> den Quellen der Genüsse nachgeht, die uns das große
> Naturgemälde bietet.“
>                                Alexander von Humboldt, 1799
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

	[[alternative HTML version deleted]]

