Commit 8e889127 authored by Alec L. Robitaille's avatar Alec L. Robitaille 馃毑

fix integer types

parent 63bf71b4
Pipeline #41492881 failed with stages
in 7 minutes and 5 seconds
......@@ -37,8 +37,14 @@ filter_qa <-
check_col(DT, 'NDVI')
check_col(DT, qa, 'qa')
if (typeof(DT[['NDVI']]) != 'integer') {
warning('casting NDVI column as integer')
DT[, 'NDVI' := as.integer(NDVI)]
}
DT[get(qa) %in% good, good := TRUE][is.na(good), good := FALSE]
DT[(good), filtered := as.integer(NDVI)]
DT[(good), filtered := NDVI]
DT[!(good), filtered := NA]
set(DT, j = 'good', value = NULL)
}
......@@ -94,7 +100,7 @@ filter_winter <-
overwrite_col(DT, 'winter')
if (typeof(DT[[doy]]) != 'integer') {
DT[, (doy) := as.integer(.SD), .SDcols = doy]
DT[, (doy) := as.integer(.SD[[1]]), .SDcols = doy]
}
if (typeof(limits) != 'integer') {
......
......@@ -33,7 +33,7 @@ remotes::install_gitlab('robit.a/irg')
### Packages
`irg` depends on two packages (and `stats`):
* [`data.table`](https://github.com/Rdatatable/data.table) for all tabular processing (hint: everything!)
* [`data.table`](https://github.com/Rdatatable/data.table) for all tabular processing
* [`RcppRoll`](https://github.com/kevinushey/RcppRoll) for fast rolling medians in `filter_roll`.
No external dependencies.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment