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

fetchSCAN: return all above-ground sensors #359

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions R/fetchSCAN.R
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,11 @@ fetchSCAN <- function(site.code = NULL, year = NULL, report = 'SCAN', timeseries
return(NULL)
}

## https://github.com/ncss-tech/soilDB/issues/14
## there may be multiple above-ground sensors (takes the first)
## there may be multiple above-ground sensors
if (length(d.cols) > 1 && code %in% c('TAVG', 'TMIN', 'TMAX', 'PRCP', 'PREC',
'SNWD', 'WTEQ', 'WDIRV', 'WSPDV', 'LRADT')) {
message(paste0('multiple sensors per site [site ', d$Site[1], '] ',
paste0(names(d)[d.cols], collapse = ',')))
# use only the first sensor
d.cols <- d.cols[1]
}

# coerce all values to double (avoids data.table warnings)
Expand Down
Loading