@@ -63,6 +63,7 @@ option_list <- list(
63
63
64
64
# # Additional filters
65
65
make_option(" --minyear" , action = " store" , default = 1945 , type = ' integer' , help = " Minimum year of occurrence (default, 1945)" ),
66
+ make_option(" --maxyear" , action = " store" , default = NA , type = ' integer' , help = " Maximum year of occurrence" ),
66
67
make_option(" --noextinct" , action = " store" , default = NA , type = ' character' , help = " Remove extinct species (provide a file with extinct specieskeys)" ),
67
68
make_option(" --excludehuman" , action = " store" , default = TRUE , type = ' logical' , help = " Exclude human records (genus Homo)" ),
68
69
make_option(" --basisofrecordinclude" , action = " store" , default = NA , type = ' character' , help = " Basis of record to include from the data" ),
@@ -132,6 +133,8 @@ LONMIN <- as.numeric( to_na(opt$lonmin) )
132
133
LONMAX <- as.numeric( to_na(opt $ lonmax ) )
133
134
134
135
MINYEAR <- as.numeric(to_na( opt $ minyear ) )
136
+ MAXYEAR <- as.numeric(to_na( opt $ maxyear ) )
137
+
135
138
EXTINCT <- to_na( opt $ noextinct )
136
139
EXCLUDEHUMAN <- as.logical( opt $ excludehuman )
137
140
@@ -178,6 +181,7 @@ cat(paste("Maximum longitude: ", LONMAX, "\n", sep = ""))
178
181
cat(paste(" Basis of record to include: " , BASISINCL , " \n " , sep = " " ))
179
182
cat(paste(" Basis of record to exclude: " , BASISEXCL , " \n " , sep = " " ))
180
183
cat(paste(" Minimum year of occurrence: " , MINYEAR , " \n " , sep = " " ))
184
+ cat(paste(" Maximum year of occurrence: " , MAXYEAR , " \n " , sep = " " ))
181
185
cat(paste(" List of extict species: " , EXTINCT , " \n " , sep = " " ))
182
186
cat(paste(" Exclusion of human records: " , EXCLUDEHUMAN , " \n " , sep = " " ))
183
187
cat(paste(" Round coordinates: " , ROUNDCOORDS , " \n " , sep = " " ))
@@ -275,6 +279,7 @@ quiet <- function(x) {
275
279
# LONMIN <- NA
276
280
# LONMAX <- NA
277
281
# MINYEAR <- 2005
282
+ # MAXYEAR <- NA
278
283
# EXTINCT <- NA
279
284
# EXCLUDEHUMAN <- TRUE
280
285
# BASISINCL <- NA
@@ -368,9 +373,13 @@ if(!is.na(BASISINCL) & !is.na(BASISEXCL)){
368
373
369
374
# # Year
370
375
if (! is.na(MINYEAR )){
371
- cat(" ..Filtering by collection date\n " )
376
+ cat(" ..Filtering by collection date (min year) \n " )
372
377
dsf <- dsf %> % filter(year > = MINYEAR )
373
378
}
379
+ if (! is.na(MAX )){
380
+ cat(" ..Filtering by collection date (max year)\n " )
381
+ dsf <- dsf %> % filter(year < = MAX )
382
+ }
374
383
375
384
# # Taxonomy filters
376
385
if (! is.na(PHYLUM )){
0 commit comments