[R-sig-eco] Errors with Simprof for cluster significance
Jari Oksanen
jari.oksanen at oulu.fi
Fri Oct 7 19:06:39 CEST 2016
Ansley, I think you may have an old version of clustsig: the current one should not give an error of missing undef.zero. Please check if you need to update.
cheers, j.o.
> On 7 Oct 2016, at 19:21 pm, Sarah Goslee <sarah.goslee at gmail.com> wrote:
>
> I can't duplicate your error. Assuming the attached document describes
> your data, it works fine. I changed the code to use braycurtis instead
> of euclidean, as you wanted, and it does return a warning, just as the
> help file documents.
>
> So you'll need to provide more information.
>
>
> data<- structure(list(necsur = c(1L, 4L, 0L, 8L, 0L, 1L), necame = c(4L,
> 5L, 9L, 9L, 4L, 7L), niccar = c(1L, 1L, 1L, 2L, 1L, 4L), nicorb = c(2L,
> 20L, 23L, 26L, 3L, 12L), nicpus = c(0L, 0L, 1L, 0L, 0L, 0L),
> nictor = c(0L, 2L, 1L, 3L, 2L, 1L), delgib = c(10L, 31L,
> 47L, 48L, 15L, 55L), cancha = c(5L, 6L, 4L, 4L, 1L, 6L),
> melbis = c(3L, 0L, 1L, 3L, 0L, 1L), atelec = c(4L, 6L, 28L,
> 22L, 8L, 52L), copmin = c(0L, 0L, 1L, 1L, 0L, 1L), ontcon = c(3L,
> 3L, 11L, 7L, 1L, 2L), ontdep = c(2L, 0L, 0L, 0L, 0L, 0L),
> onthec = c(17L, 15L, 9L, 6L, 6L, 2L), ontstr = c(0L, 0L,
> 0L, 1L, 1L, 0L), onttau = c(20L, 13L, 6L, 2L, 0L, 2L), ontpen = c(2L,
> 3L, 5L, 3L, 2L, 4L), onttub = c(2L, 3L, 4L, 1L, 1L, 0L),
> phavin = c(1L, 0L, 0L, 0L, 0L, 1L), Phyili = c(0L, 0L, 0L,
> 0L, 0L, 1L), canvir = c(0L, 1L, 0L, 0L, 0L, 0L), hybill = c(1L,
> 0L, 0L, 0L, 0L, 0L), cyclev = c(0L, 0L, 0L, 0L, 1L, 1L),
> galjan = c(0L, 0L, 1L, 1L, 0L, 0L), cyclosig = c(0L, 0L,
> 0L, 0L, 1L, 0L), omomon = c(1L, 2L, 4L, 10L, 1L, 6L), trofov = c(1L,
> 2L, 3L, 1L, 0L, 1L), trouni = c(1L, 0L, 0L, 1L, 0L, 0L),
> troter = c(0L, 1L, 1L, 0L, 0L, 0L), eusass = c(9L, 8L, 23L,
> 14L, 11L, 28L), hiscoe = c(2L, 1L, 10L, 4L, 2L, 4L), hisabb = c(0L,
> 0L, 0L, 0L, 2L, 0L), cremax = c(4L, 7L, 1L, 2L, 2L, 5L),
> plamac = c(1L, 0L, 3L, 2L, 2L, 2L), plafem = c(0L, 0L, 0L,
> 0L, 0L, 0L), plafos = c(1L, 1L, 3L, 2L, 1L, 2L), placom = c(6L,
> 3L, 3L, 10L, 13L, 7L), tacfim = c(0L, 0L, 1L, 0L, 0L, 0L)), .Names
> = c("necsur",
> "necame", "niccar", "nicorb", "nicpus", "nictor", "delgib", "cancha",
> "melbis", "atelec", "copmin", "ontcon", "ontdep", "onthec", "ontstr",
> "onttau", "ontpen", "onttub", "phavin", "Phyili", "canvir", "hybill",
> "cyclev", "galjan", "cyclosig", "omomon", "trofov", "trouni",
> "troter", "eusass", "hiscoe", "hisabb", "cremax", "plamac", "plafem",
> "plafos", "placom", "tacfim"), row.names = c("AP-0", "AP-100",
> "AP-200", "AP-300", "ST-0", "ST-100"), class = "data.frame")
>
>
>> simprof(data, num.expected=1000, num.simulated=999,
> + method.cluster="average", method.distance="braycurtis",
> + method.transform="identity", alpha=0.05,
> + sample.orientation="row", const=0,
> + silent=TRUE, increment=100,
> + undef.zero=TRUE, warn.braycurtis=TRUE)
> $numgroups
> [1] 2
>
> $pval
> [,1] [,2] [,3]
> [1,] -3 -4 NA
> [2,] -6 1 0.461461461
> [3,] -1 -2 NA
> [4,] -5 3 0.905905906
> [5,] 2 4 0.003003003
>
> $hclust
>
> Call:
> hclust(d = rawdata.dist, method = method.cluster)
>
> Cluster method : average
> Number of objects: 6
>
>
> $significantclusters
> $significantclusters[[1]]
> [1] "ST-100" "AP-200" "AP-300"
>
> $significantclusters[[2]]
> [1] "ST-0" "AP-0" "AP-100"
>
>
> Warning messages:
> 1: This version of the Bray-Curtis index does not use standardization.
> 2: To use the standardized version, use "actual-braycurtis".
> 3: See the help documentation for more information.
>
>
> On Thu, Oct 6, 2016 at 8:43 PM, Ansley Silva <daily.puja at gmail.com> wrote:
>> Hello all,
>>
>> I'm using R version 3.3.1, clustsig package.
>>
>> I have a community dataset and I originally used hclust in the vegan
>> package to get dendrograms, however I need significance on the groups that
>> were formed. I'd really like to use SIMPROF to look for significance among
>> the groups, but I am running into errors.
>>
>>
>> These are the errors I get:
>>
>>> simprof(apst, num.expected=1000, num.simulated=999,
>> method.cluster="average", method.distance="braycurtis", alpha=0.05,
>> sample.orientation = "column", const = 0, silent = TRUE,increment=100)
>>
>> Error: argument "undef.zero" is missing, with no default
>> In addition: Warning messages:
>> 1: This version of the Bray-Curtis index does not use standardization.
>> 2: To use the standardized version, use "actual-braycurtis".
>> 3: See the help documentation for more information.
>>
>>> simprof(apst, num.expected=1000, num.simulated=999,
>> method.cluster="average", method.distance="actual-braycurtis", alpha=0.05,
>> sample.orientation = "column", const = 0, silent = TRUE,increment=100)
>>
>> Error in if (denom != 0) { : missing value where TRUE/FALSE needed
>>
>>> simprof(apst, num.expected=1000, num.simulated=999,
>> method.cluster="average", method.distance="braycurtis", alpha=0.05,
>> sample.orientation = "column", const = 0, silent = TRUE,increment=100)
>>
>> Error: argument "undef.zero" is missing, with no default
>> In addition: Warning messages:
>> 1: This version of the Bray-Curtis index does not use standardization.
>> 2: To use the standardized version, use "actual-braycurtis".
>> 3: See the help documentation for more information.
>>
>>> simprof(apst, num.expected=1000, num.simulated=999,
>> method.cluster="average",
>> method.transform="log",method.distance="braycurtis", alpha=0.05,
>> sample.orientation = "column", const = 0, silent = TRUE,increment=100)
>>
>> Error in if (pval > alpha) { : missing value where TRUE/FALSE needed
>> In addition: Warning messages:
>> 1: This version of the Bray-Curtis index does not use standardization.
>> 2: To use the standardized version, use "actual-braycurtis".
>> 3: See the help documentation for more information.
>>
>>
>>
>> I have some samples were the columns added up to zero, so I tried removing
>> them since I was using method.transform="log". But that didn't seem to
>> change anything.
>> I also tried transposing the data, but no luck there.
>> I am using braycurtis, but have tried actual-braycurtis and that did not
>> help.
>> I have also tried tweeking undef.zero.
>>
>>
>> If anyone could help provide some solutions, that would be greatly
>> appreciated.
>> Please and thank you,
>>
>> --
>> Ansley Silva
>>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
More information about the R-sig-ecology
mailing list