joeroe / era

R package for year-based time scales

Home Page:https://era.joeroe.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

era(NA) has unexpected results

joeroe opened this issue · comments

As a result of 86a6015, passing NA to era() constructs every available standard era:

library("era")
era(NA)
#> <era[24]>
#>  [1] Before Present (BP): calendar years, counted backwards from 1950                        
#>  [2] Before Present (cal BP): calendar years, counted backwards from 1950                    
#>  [3] Before Christ (BC): calendar years, counted backwards from 0                            
#>  [4] Before Common Era (BCE): calendar years, counted backwards from 0                       
#>  [5] Anno Domini (AD): calendar years, counted forwards from 0                               
#>  [6] Common Era (CE): calendar years, counted forwards from 0                                
#>  [7] kiloannum (ka): calendar (×1000) years, counted backwards from 1950                     
#>  [8] megaannum (Ma): calendar (×1e+06) years, counted backwards from 1950                    
#>  [9] gigaannum (Ga): calendar (×1e+09) years, counted backwards from 1950                    
#> [10] thousand years ago (kya): calendar (×1000) years, counted backwards from 1950           
#> [11] million years ago (mya): calendar (×1e+06) years, counted backwards from 1950           
#> [12] billion years ago (bya): calendar (×1e+09) years, counted backwards from 1950           
#> [13] years before 2000 (b2k): calendar years, counted backwards from 2000                    
#> [14] uncalibrated Before Present (uncal BP): radiocarbon years, counted backwards from 1950  
#> [15] Radiocarbon Years Before Present (RCYBP): radiocarbon years, counted backwards from 1950
#> [16] Before Present (uncalibrated) (bp): radiocarbon years, counted backwards from 1950      
#> [17] Before Christ (uncalibrated) (bc): radiocarbon years, counted backwards from 1950       
#> [18] Before Common Era (uncalibrated) (bce): radiocarbon years, counted backwards from 1950  
#> [19] Anno Domini (uncalibrated) (ad): radiocarbon years, counted forwards from 1950          
#> [20] Common Era (uncalibrated) (ce): radiocarbon years, counted forwards from 1950           
#> [21] Holocene Era (HE): calendar years, counted forwards from -10000                         
#> [22] Before Holocene Era (BHE): calendar years, counted backwards from -10000                
#> [23] Anno Lucis (AL): calendar years, counted forwards from -4000                            
#> [24] After the Development of Agriculture (ADA): calendar years, counted forwards from -8000

This is a neat trick but probably not expected from the user's point of view. It should either throw an error (could handled in validation – #7) or return an NA-era.