View source: R/mars_data_fetch_write_functions.R
marsFetchBaroData | R Documentation |
Returns a data frame with datetime, barometric pressure, smp id, and number of neighbors interpolated from to collect the data.
marsFetchBaroData(
con,
target_id,
start_date,
end_date,
data_interval = c("5 mins", "15 mins")
)
con |
An ODBC connection to the MARS Analysis database returned by odbc::dbConnect |
target_id |
chr, single SMP ID where the user has requested data |
start_date |
string or POSIXct, format: "YYYY-MM-DD", start of data request range |
end_date |
string or POSIXct, format: "YYYY-MM-DD", end of data request range |
data_interval |
chr, |
Output will be a dataframe with four columns:
dtime_est |
POSIXct, format: "YYYY-MM-DD HH:MM:SS" |
baro_psi |
num, barometric pressure in psi |
smp_id |
chr, SMP ID for each baro |
neighbors |
num, count of baros interpolated from |
If the target SMP has an on-site baro with data, the "neighbors" column will be NA.
If there are fewer than five baros to interprolate from, based on marsInterpolateBaro
,
all columns other than "dtime_est" will be NA.
The function will also output and open an html document describing the data request and including a raster plot of barometric pressures. (This feature is currently disabled. 2/2/21 - NM)
marsInterpolateBaro
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.