arrowDir: Arrow direction fitting for Arrowhead function from "shape"...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/wind_functions2.R

Description

arrowDir adapts wind direction value to be used by Arrowhead function from "shape" package to plot wind direction for each coordinate.

Usage

1

Arguments

W

An object of class rWind or a data.frame which should content a column named "dir".

Details

Angle argument of Arrowhead function from "shape" package needs to be fed in an anti-clockwise way, relative to x-axis, in degrees 0,360. arrowDir function adapts wind direction provided by wind.fit (clockwise, relative to y-axis ) to requirements of Arrowhead.

Value

A vector with angles for each arrow to be plotted by Arrowhead.

Note

arrowDir function works always together with Arrowhead function from "shape" package.

Author(s)

Javier Fernández-López

References

Karline Soetaert (2017). shape: Functions for Plotting Graphical Shapes, Colors. R package version 1.4.3. https://CRAN.R-project.org/package=shape

See Also

wind.dl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(wind.data)

# Create a vector with wind direction (angles) adapted
alpha <- arrowDir(wind.data)
## Not run: 
# Now, you can plot wind direction with Arrowhead function from shapes package
# Load "shape package
require(shape)
plot(wind.data$lon, wind.data$lat, type = "n")
Arrowhead(wind.data$lon, wind.data$lat,
  angle = alpha,
  arr.length = 0.1, arr.type = "curved"
)

## End(Not run)

rWind documentation built on Oct. 19, 2021, 5:06 p.m.