Giter Club home page Giter Club logo

compadredb's People

Contributors

jonesor avatar robsalgo avatar sckott avatar tdjames1 avatar

Watchers

 avatar  avatar

compadredb's Issues

extractVitalRates() shouldn't return NaN

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

rearrangeMatrix() fails when matF contains NA

Example from Bernt-Erik Sæther, Øvind Bakke. 2000. Life history variation and contribution of different demographic traits to the population growth rate in birds: a comparative approach. Ecology 81: 642-653.

 saetherMatrices$`Diomedea exulans`
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
 [1,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00    NA
 [2,] 0.92 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [3,] 0.00 0.92 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [4,] 0.00 0.00 0.92 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [5,] 0.00 0.00 0.00 0.92 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [6,] 0.00 0.00 0.00 0.00 0.92 0.00 0.00 0.00 0.00  0.00  0.00
 [7,] 0.00 0.00 0.00 0.00 0.00 0.92 0.00 0.00 0.00  0.00  0.00
 [8,] 0.00 0.00 0.00 0.00 0.00 0.00 0.92 0.00 0.00  0.00  0.00
 [9,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.92 0.00  0.00  0.00
[10,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.92  0.00  0.00
[11,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.92  0.92

Decomposed using values above the diagonal as the fecundity matrix, remaining values as growth/transition.

[1] "Species:  Diomedea exulans"
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
 [1,]    0    0    0    0    0    0    0    0    0     0    NA
 [2,]    0    0    0    0    0    0    0    0    0     0     0
 [3,]    0    0    0    0    0    0    0    0    0     0     0
 [4,]    0    0    0    0    0    0    0    0    0     0     0
 [5,]    0    0    0    0    0    0    0    0    0     0     0
 [6,]    0    0    0    0    0    0    0    0    0     0     0
 [7,]    0    0    0    0    0    0    0    0    0     0     0
 [8,]    0    0    0    0    0    0    0    0    0     0     0
 [9,]    0    0    0    0    0    0    0    0    0     0     0
[10,]    0    0    0    0    0    0    0    0    0     0     0
[11,]    0    0    0    0    0    0    0    0    0     0     0
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
 [1,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [2,] 0.92 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [3,] 0.00 0.92 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [4,] 0.00 0.00 0.92 0.00 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [5,] 0.00 0.00 0.00 0.92 0.00 0.00 0.00 0.00 0.00  0.00  0.00
 [6,] 0.00 0.00 0.00 0.00 0.92 0.00 0.00 0.00 0.00  0.00  0.00
 [7,] 0.00 0.00 0.00 0.00 0.00 0.92 0.00 0.00 0.00  0.00  0.00
 [8,] 0.00 0.00 0.00 0.00 0.00 0.00 0.92 0.00 0.00  0.00  0.00
 [9,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.92 0.00  0.00  0.00
[10,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.92  0.00  0.00
[11,] 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00  0.92  0.92
Error in Rep[1]:Rep[length(Rep)] : argument of length 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.