rbchan / unmarked

R package for hierarchical models in ecological research
https://rbchan.github.io/unmarked/
36 stars 25 forks source link

Fix formatMult conversion of julian date/visit to factor #100

Closed adamdsmith closed 8 years ago

adamdsmith commented 8 years ago

Fixed formatMult so that input Julian date (JD)/visit chronology information is not converted to factor when it is not, in fact, a factor. When factor variables are present as additional covariates, the JD/visit chronology variable was coerced to a factor as the intermediate array could only store data with a single mode --- in this case a "character" mode subsequently converted into a factor. Other non-factor variables are returned to their original mode. The function now checks the the mode of the JD/visit variable and restores it to its original mode if not a factor.

Unit test updated as well.