tdjames1 / compadreDB

Code and data for the COMPADRE Plant Matrix Database and COMADRE Animal Matrix Database
GNU General Public License v2.0
0 stars 0 forks source link

extractVitalRates() shouldn't return NaN #1

Closed tdjames1 closed 7 years ago

tdjames1 commented 7 years ago

Need to deal with degenerate matrices that create NaN values.

Example: matrix with juvenile survival and transition both specified as zero.

!> comadre$version                                                                                                                                                                                                        
 $Version                                                                                                                                                                                                                 
 [1] "X.X.X"                                                                                                                                                                                                              

 $DateCreated                                                                                                                                                                                                             
 [1] "Jun_09_2017"                                                                                                                                                                                                        

 $NumberAcceptedSpecies                                                                                                                                                                                                   
 [1] 456                                                                                                                                                                                                                  

 $NumberStudies                                                                                                                                                                                                           
 [1] 586                                                                                                                                                                                                                  

 $NumberMatrices                                                                                                                                                                                                          
 [1] 2207                                                                                                                                                                                                                 

 $Agreement                                                                                                                                                                                                               
 [1] "http://www.compadre-db.org/Page/UserAgreement"
!> comadre$mat[[454]]
 $matA
      A1          A2
 [1,]  0 2.630585000
 [2,]  0 0.002427184

 $matU
      U1          U2
 [1,]  0 0.000000000
 [2,]  0 0.002427184

 $matF
      F1       F2
 [1,]  0 2.630585
 [2,]  0 0.000000

 $matC
      C1 C2
 [1,]  0  0
 [2,]  0  0
tdjames1 commented 7 years ago

Fixed in ce015c3318132c2b79ecdbc601bde97144aaba32.