[R-sig-eco] Bugs in "FD" package, function dbFD ()

Novack-Gottshall, Philip M. pnovack-gottshall at ben.edu
Wed Jul 15 16:41:02 CEST 2015


This one's just as simple. The geometry package needs to create, save, and read a vertices txt file (vert.txt) for FD to calculate convex hull volume / FRic. I'm guessing (since it also occurs for you with the example code in dbFD) that it's trying to write to a location that you don't have read-write permission to access.

Try setting the working directory directly, using setwd(), and you should be good to go.

Phil


On 7/15/2015 9:29 AM, Laura Riggi wrote:
> Thanks for your help!
> It appears that I needed to leave the corner tab of each data frame empty and it worked.
>
> However now there seems to be a problem with the package it-self.
>
>> ex1 <- dbFD(x,a)
> Error in convhulln(tr.FRic, "FA") : Unable to write to current directory.
>  This is a known issue in the geometry package
>  See https://r-forge.r-project.org/tracker/index.php?func=detail&aid=5738&group_id=1149&atid=4552 
>
> The same error comes up when doing the example from the FD package.
> Any idea how to get around this?
>
> Thank you/Grazie
> Laura
>
> -----Original Message-----
> From: Novack-Gottshall, Philip M. [mailto:pnovack-gottshall at ben.edu] 
> Sent: den 15 juli 2015 16:12
> To: Laura Riggi; r-sig-ecology at r-project.org
> Subject: Re: [R-sig-eco] error message in package "FD", function dbFD ()
>
> Laura,
>
> Does one of your species names have a blank space at the end of it (that's invisible to your eye, but seen by R)?
>
> Without your actual data files, I can't diagnose the exact details. But if you "reveal" the dbFD() code [command line: > dbFD] and search for your error message, you'll find that somehow the row names for your transposed "a" file are not identical to the row names for your "x" file.
>
> Try the following to confirm:
> identical(row.names(x), row.names(t(a)))
>
> I'm guess this will yield "FALSE" (although they look identical in your output below).
>
> If FALSE, then you just need to confirm that the species names are actually identical (is there a space at the end of one?, or manually re-type to confirm, etc., etc.).
>
> Good luck,
> Phil
>
> On 7/15/2015 8:42 AM, Laura Riggi wrote:
>> Dear R community,
>>
>>
>>
>> I  have some trouble with the dbFD function in the FD package.
>>
>>> str(a)
>> 'data.frame':    150 obs. of  48 variables:
>>
>>> str(x)
>> 'data.frame':    48 obs. of  9 variables:
>>
>>
>>
>> ex1 <- dbFD(x,a)
>>
>> Error in dbFD(x, a) :
>>
>>   Species labels in 'x' and 'a' need to be identical and ordered alphabetically (or simply in the same order).
>>
>>
>>
>> I have checked multiple time the data set but this message keeps on appearing. The names of the species are identical in both data.frames.
>>
>>
>>
>> I was wondering if you could help me by giving me an example of an excel trait and species matrix table to upload for this package. Below is a snapshop of my data. I have also checked that there are no NA's problems and that there is no species abundance = 0 or no community with 0 species.
>>
>>
>>
>> Thank you for any advice!
>>
>> Best
>>
>> Laura
>>
>>
>>
>> Species table (a)
>> Agonum_assimile
>>
>> Agonum_dorsale
>>
>> Agonum_gracile
>>
>> Agonum_gracilipes
>>
>> 2
>>
>> 3
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 6
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 10
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 5
>>
>> 0
>>
>> 0
>>
>> 0
>>
>> 8
>>
>> 0
>>
>> 0
>>
>> 2
>>
>> 7
>>
>> 0
>>
>> 0
>>
>> 1
>>
>> 6
>>
>> 0
>>
>> 0
>>
>>
>>
>>
>>
>>
>> Trait table(x)
>>
>>
>> Species
>>
>> SizeCategoy
>>
>> Ecology
>>
>> Reproduction
>>
>> Diet
>>
>> Wing
>>
>> Agonum_assimile
>>
>> C
>>
>> nocturnal
>>
>> spring
>>
>> Carnivorous
>>
>> Brachypterous
>>
>> Agonum_dorsale
>>
>> B
>>
>> nocturnal
>>
>> spring
>>
>> Carnivorous
>>
>> Macropterous
>>
>> Agonum_gracile
>>
>> B
>>
>> diurnal
>>
>> spring
>>
>> Carnivorous
>>
>> Macropterous
>>
>> Agonum_gracilipes
>>
>> B
>>
>> both
>>
>> spring
>>
>> Carnivorous
>>
>> Macropterous
>>
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-ecology mailing list
>> R-sig-ecology at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  Phil Novack-Gottshall
>  Associate Professor
>  Department of Biological Sciences
>  Benedictine University
>  5700 College Road
>  Lisle, IL 60532
>
>  pnovack-gottshall at ben.edu
>  Phone: 630-829-6514
>  Fax: 630-829-6547
>  Office: 332 Birck Hall
>  Lab: 316 Birck Hall
>  http://www1.ben.edu/faculty/pnovack-gottshall
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Phil Novack-Gottshall
 Associate Professor
 Department of Biological Sciences
 Benedictine University
 5700 College Road 
 Lisle, IL 60532

 pnovack-gottshall at ben.edu
 Phone: 630-829-6514
 Fax: 630-829-6547
 Office: 332 Birck Hall
 Lab: 316 Birck Hall
 http://www1.ben.edu/faculty/pnovack-gottshall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the R-sig-ecology mailing list