Open dylanbeaudette opened 2 years ago
A note to extend methods where possible so that they can work with other data sources e.g. SCAN, CDEC
Looks like we will also need to change the usage of base::as.POSIXct()
format
argument in soilDB:::.fill_missing_days()
as it is breaking with R devel.
══ Failed tests ════════════════════════════════════════════════════════════════
── Error (test-fetchHenry.R:122:3): summarizeSoilTemperature() works as expected ──
Error in `.POSIXct(x, tz, ...)`: unused argument (format = "%Y-%m-%d %H:%M:%S")
Backtrace:
▆
1. ├─soilDB:::.formatDates(x, gran = "day", pad.missing.days = TRUE) at test-fetchHenry.R:122:2
2. │ ├─...[]
3. │ └─data.table:::`[.data.table`(...)
4. └─soilDB:::.fill_missing_days(.SD)
5. ├─base::as.POSIXct(x$date_time, format = "%Y-%m-%d %H:%M:%S")
6. └─base::as.POSIXct.default(x$date_time, format = "%Y-%m-%d %H:%M:%S")
── Error (test-fetchHenry.R:165:3): .fill_missing_days() works as expected ─────
Error in `.POSIXct(x, tz, ...)`: unused argument (format = "%Y-%m-%d %H:%M:%S")
Backtrace:
▆
1. └─soilDB:::.fill_missing_days(x) at test-fetchHenry.R:165:2
2. ├─base::as.POSIXct(x$date_time, format = "%Y-%m-%d %H:%M:%S")
3. └─base::as.POSIXct.default(x$date_time, format = "%Y-%m-%d %H:%M:%S")
I'll try to take a look next week sometime, unless you have time before then. Can you tackle the POSIX thing?
I'll try to take a look next week sometime, unless you have time before then.
Take a look at this issue as a whole? I can probably take a crack at it this week sometime
Can you tackle the POSIX thing?
This is sorted w/ https://github.com/ncss-tech/soilDB/commit/6d4c02b553b52f67ffd4b0da9d8ae15c2c9ad0f4 as.Date()
still takes format arg, so I converted character->Date explicitly with as.Date(..., format=)
and then to POSIXct and we are good
I'll try to take a look next week sometime, unless you have time before then.
Take a look at this issue as a whole? I can probably take a crack at it this week sometime
Go for it if you have some time. I'm not going to have enough time this week.
Can you tackle the POSIX thing?
This is sorted w/ 6d4c02b
as.Date()
still takes format arg, so I converted character->Date explicitly withas.Date(..., format=)
and then to POSIXct and we are good
Thanks, the as.Date(
fix was news to me.
I'll try to take a look next week sometime, unless you have time before then.
Take a look at this issue as a whole? I can probably take a crack at it this week sometime
Go for it if you have some time. I'm not going to have enough time this week.
Can you tackle the POSIX thing?
This is sorted w/ 6d4c02b
as.Date()
still takes format arg, so I converted character->Date explicitly withas.Date(..., format=)
and then to POSIXct and we are good
Thanks, the as.Date(
fix was news to me.
TODO:
.fill_missing_days()
with new function andgran
argument: days, weeks, months.formatDates()
with new functionfetchHenry()
for generic NA paddingFurther research: https://stackoverflow.com/questions/22439540/how-to-get-week-numbers-from-dates
First approximation here.