View source: R/mars_data_fetch_write_functions.R
marsInterpolateBaro | R Documentation |
Returns an interpolated barometric pressure reading or NA
marsInterpolateBaro(baro_psi, smp_id, weight, target_id)
baro_psi |
vector, num, barometric pressures measured at the same timestamp |
smp_id |
vector, chr, SMP IDs where the measurements took place |
weight |
vector, num, of inverse distances weights for each baro, calculated by |
target_id |
chr, single SMP ID where the user has requested data |
Output will be a single barometric pressure reading.
If there are 4 or greater baros with data,
the reading will be an inverse distance-weighted
interpolation of those readings.
If there are fewer than 4 readings, return NA
.
marsFetchBaroData
,
data: marsSampleBaro
data(marsSampleBaro)
marsInterpolateBaro(
baro_psi = marsSampleBaro[[1]]$baro_psi,
smp_id = marsSampleBaro[[1]]$smp_id,
weight = marsSampleBaro[[1]]$weight,
target_id = marsSampleBaro[[2]]
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.