Hi Sara,
Thank you for your advice and apologies for spamming.
I will try to reorganise the arguments and if it doesn't work, will try
r-sig-ecology.
Kind regards,
Vesna
On 2021-04-01 0:58, Sarah Goslee wrote:> Hi,
>
> While Bert is right that this would be a good question for
> r-sig-ecology, I think you might have made a very simple-to-fix
> mistake:
>
> According to
> https://www.rdocumentation.org/packages/FD/versions/1.0-12/topics/dbFD
> if you don't name the arguments, traits should come BEFORE sites.
>
> If that doesn't help, take a look at the site and trait data frames
> used in the examples and see if you can figure out where you went
> wrong. If you can't, then try r-sig-ecology.
>
> Sarah
>
> On Wed, Mar 31, 2021 at 6:33 PM Vesna Gulin <vesna.gulin at
biol.pmf.hr>
> wrote:
>>
>> Hi everyone,
>>
>> I am trying to conduct dbFD from the FD package, but it keeps giving
>> me
>> the same error:
>>
>> ex1 <- dbFD(sites, traits)
>> Error in dbFD(sites, traits) :
>> Different number of species in 'x' and 'a'.
>>
>> Ab, bb, Ci.... are species names.
>> I have tried rewriting the species names so many times and ways, but
>> nothing seems to work. I also checked for blank space but can't
seem
>> to
>> find one. Does anyone have and idea what am I doing wrong?
>>
>> My data consists of two data frames:
>> sites
>>
>> X Ab Bb Ci Cb Cbm Cdo Cm Cdi Dv Edi Ee Ede Es Eb Gc La Mm Op Oc Oh
>> Or
>> Pgr Ps Pgi Pf Pgri Po Pp Rr Ss Sl Ts Tv Tr
>> 1 A 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 2 B 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 0
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 3 C 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 0
>> 0 0 0 0 0 1 0 0 0 0 0 0 0
>> 4 D 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 5 E 0 0 0 0 0 0 0 3 2 3 0 0 0 0 0 0 0 0 0 4
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0
>> 6 F 0 0 0 0 0 0 0 0 3 0 1 0 0 4 1 8 0 1 3 2
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 2
>> 7 G 0 0 0 0 0 0 1 1 1 2 0 0 0 0 0 0 0 0 1 4
>> 0
>> 0 0 0 0 0 0 0 0 0 0 0 0 0
>>
>> traits
>>
>> X body ration flight feeding lifestyle
>> moisture
>> 1 Ab 29.5 0.6203390 none herbivorous geo-chortobiont
>> xerophilous
>> 2 Bb 16.0 1.0625000 reduced omnivorous chortobiont
>> mesophilous
>> 3 Ci 23.5 0.5829787 full omnivorous geo-chortobiont
>> xerophilous
>> 4 Cb 18.0 0.6000000 full herbivorous chortobiont
>> mesophilous
>> 5 Cbm 18.0 0.6000000 full herbivorous chortobiont
>> mesophilous
>> 6 Cdo 17.5 0.6342857 reduced herbivorous chortobiont
>> mesophilous
>> 7 Cm 17.5 0.5914286 full herbivorous chortobiont
>> mesophilous
>> 8 Cdi 21.5 0.5883721 reduced herbivorous chortobiont
>> hygrophilous
>> 9 Dv 34.0 0.9044118 reduced carnivorous geo-chortobiont
>> mesophilous
>> 10 Edi 27.0 0.7222222 none omnivorous thamnobiont
>> xerophilous
>> 11 Ee 25.0 0.6400000 none omnivorous thamnobiont
>> mesophilous
>> 12 Ede 20.5 0.5902439 none herbivorous chortobiont
>> xerophilous
>> 13 Es 25.5 0.9803922 none omnivorous thamnobiont
>> mesophilous
>> 14 Eb 18.0 0.6416667 reduced herbivorous chortobiont
>> mesophilous
>> 15 Gc 22.5 0.4555556 none omnivorous geobiont
>> mesophilous
>> 16 La 13.0 0.9807692 none herbivorous chortobiont
>> mesophilous
>> 17 Mm 18.0 1.0972222 none omnivorous geo-chortobiont
>> xerophilous
>> 18 Op 12.0 0.6666667 full omnivorous thamnobiont
>> xerophilous
>> 19 Oc 21.0 0.5690476 full herbivorous geobiont
>> xerophilous
>> 20 Oh 15.5 0.5967742 reduced herbivorous chortobiont
>> mesophilous
>> 21 Or 15.5 0.7193548 reduced herbivorous chortobiont
>> mesophilous
>> 22 Pgr 17.0 1.0588235 none omnivorous thamnobiont
>> mesophilous
>> 23 Ps 21.5 1.0465116 none omnivorous thamnobiont
>> mesophilous
>> 24 Pgi 14.0 0.5500000 none herbivorous chortobiont
>> mesophilous
>> 25 Pf 26.5 0.9622642 none omnivorous thamnobiont
>> mesophilous
>> 26 Pgri 17.5 1.0428571 none omnivorous thamnobiont
>> mesophilous
>> 27 Po 17.0 0.8970588 none herbivorous chortobiont
>> mesophilous
>> 28 Pp 17.5 0.6542857 reduced herbivorous chortobiont
>> mesophilous
>> 29 Rr 17.5 0.8857143 reduced omnivorous chortobiont
>> mesophilous
>> 30 Ss 22.5 0.5733333 full herbivorous chortobiont
>> mesophilous
>> 31 Sl 20.5 0.6268293 reduced herbivorous chortobiont
>> mesophilous
>> 32 Ts 12.5 0.4720000 reduced herbivorous geobiont
>> hygrophilous
>> 33 Tv 33.0 0.7803030 full carnivorous thamnobiont
>> mesophilous
>> 34 Tr 20.0 0.9000000 none omnivorous geobiont
>> hygrophilous
>>
>>
>> Thank you in advance and kind regards,
>> Vesna
>>
>>
>> --
>> Vesna Gulin, Research and Teaching Assistant
>> Department of Biology
>> Faculty of Science
>> University of Zagreb
>> Rooseveltov trg 6, 10000 Zagreb, Croatia
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.