Mercurial > repos > greg > extract_ipm_date_interval
comparison extract_ipm_date_interval.R @ 4:3741790740f3 draft
Uploaded
| author | greg |
|---|---|
| date | Wed, 01 Aug 2018 08:21:56 -0400 |
| parents | 3126def1a8e9 |
| children | 87482a201699 |
comparison
equal
deleted
inserted
replaced
| 3:3126def1a8e9 | 4:3741790740f3 |
|---|---|
| 28 # Galaxy should soon include support for a date selector | 28 # Galaxy should soon include support for a date selector |
| 29 # at which point this tool should be enhanced to use it. | 29 # at which point this tool should be enhanced to use it. |
| 30 # Validate start_date. | 30 # Validate start_date. |
| 31 | 31 |
| 32 # Calaculate the number of days in the date interval. | 32 # Calaculate the number of days in the date interval. |
| 33 start_date = validate_date(opt$start_date); | 33 start_date = validate_date(format(opt$start_date)); |
| 34 # Validate end_date. | 34 # Validate end_date. |
| 35 end_date = validate_date(opt$end_date); | 35 end_date = validate_date(format(opt$end_date)); |
| 36 if (start_date >= end_date) { | 36 if (start_date >= end_date) { |
| 37 stop_err("The start date must be between 1 and 50 days before the end date when setting date intervals for plots."); | 37 stop_err("The start date must be between 1 and 50 days before the end date when setting date intervals for plots."); |
| 38 } | 38 } |
| 39 # Calculate the number of days in the date interval. | 39 # Calculate the number of days in the date interval. |
| 40 num_days = difftime(end_date, start_date, units=c("days")); | 40 num_days = difftime(end_date, start_date, units=c("days")); |
