View source: R/rtools.trajectory.R
season.trajectory | R Documentation |
Functions to process and analyse storm trajectories
## S3 method for class 'trajectory'
season(x, format = "character", verbose = FALSE)
x |
A trajectory object |
verbose |
if TRUE print information about progress |
... |
Other arguments |
type |
type of anomaly: 'first' gives you the spatial anomaly with regards to the first time step of the trajectory and 'mean' centers the trajectories around the mean longitude and latitude |
param |
parameters to calculate anomaly of |
A trajecory object
Kajsa M. Parding
# Load trajectory example data
data('imilast.M03')
# Calculate anomaly
x <- anomaly(imilast.M03)
# Show maps of original trajectories and spatial anomalies
map(imilast.M03, new=FALSE)
map(x, new=FALSE)
# Transform trajectory anomalies back to regular trajectories
y <- anomaly2trajectory(x)
# Print longitudes of first trajectory
imilast.M03[1,1:12]
x[1,1:12]
y[1,12]
# Fit polynomial to trajectories
y <- polyfit.trajectory(x)
# Show coefficients of first trajectory
print(attr(y,"coefs")[,1])
# Plot original trajectory and polynomial fit
ilon <- colnames(x)=="lon"
ilat <- colnames(x)=="lat"
plot(x[1,ilon], x[1,ilat], col="black", pch=1)
lines(y[1,ilon], y[1,ilat], col="blue", lty=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.