sl.trajectory.remaptime | R Documentation |
Remap longitudes and latitudes of one or more trajectories on a sphere to a new time axis.
sl.trajectory.remaptime(oldtime, oldlat, oldlon, newtime, method = "linear", extrapolate = FALSE, return.remapinfo = FALSE, verbose = TRUE)
oldtime |
a numeric vector of length |
oldlat |
a numeric vector of length |
oldlon |
a numeric vector of length |
newtime |
a numeric vector of length |
method |
a character specifying the interpolation method. Must be one of |
extrapolate |
a logical value specifying whether or not to extrapolate to times outside the original time range. Default is |
return.remapinfo |
a logical value specifying whether or not to return information on the remapping (nearest-neighbour-before indices and weights). Default is |
verbose |
a logical value specifying whether to produce warnings, in particular when the new time axis reaches outside the original time axis. Default is |
Lat |
a numeric vector of length |
Lon |
a numeric vector of length |
If return.remapinfo=TRUE
, an additional list element remapinfo
is returned, with the following sub-elements:
weights.left.ind |
an integer vector of length |
weights.left |
an numeric vector of length |
This function is used in the R-package SIDFEx
to remap ice drift forecast trajectories.
Helge Goessling
sl.trajectory.remaptime(oldtime = 1:4, oldlat = 2:5, oldlon = seq(0,15,5), newtime = seq(2,5,pi/10), extrapolate = TRUE)
# Should return warnings related to the extrapolation and the following output:
# $Lat
# [1] 3.000000 3.316975 3.631464 3.943230 4.259835 4.575002 4.886745 5.194824 5.499004 5.799052
#
# $Lon
# [1] 5.000000 6.569664 8.140331 9.712088 11.281895 12.852290 14.424061 15.997287 17.572041 19.148394
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.