Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

era(NA) has unexpected results #20

Closed
joeroe opened this issue Nov 11, 2020 · 0 comments
Closed

era(NA) has unexpected results #20

joeroe opened this issue Nov 11, 2020 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@joeroe
Copy link
Owner

joeroe commented Nov 11, 2020

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.

@joeroe joeroe added the bug Something isn't working label Nov 11, 2020
@joeroe joeroe added this to the v0.3 (CRAN) milestone Nov 11, 2020
@joeroe joeroe closed this as completed in 5ea04bf Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant