Description Usage Arguments Value See Also Examples
Using the latitude and longitude columns of the supplied formatted data, a vector of elevation values is returned of the same length. If no elevation data files exist within the working directory, files are first downloaded. Note that NAs in the data will return corresponding NAs in the corrected elevation.
1 | elevation_correct(data, country)
|
data |
a dataset with longitude ("lng") and lattitude ("lon") columns. |
country |
character string; the country to which the data pertain, given
as an ISO3 code (see |
a vector of elevation values. If there is an error at any stage, a vector of NAs is returned.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
data(ridedata)
## When run the first time, geographical data will need to be downloaded.
ridedata$elevation.corrected <- elevation_correct(ridedata, "GBR")
## A Bland-Altman-type plot.
difference <- ridedata$elevation.m - ridedata$elevation.corrected
plot(difference ~ ridedata$timer.min, cex = 0.2, ylab = "raw minus corrected")
m <- mean(difference, na.rm = TRUE); stdev <- sd(difference, na.rm = TRUE)
abline(h = c(m + c(-stdev, 0, stdev)), lty = c(1, 2, 1), col = "red")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.