if (requireNamespace("ggplot2") && requireNamespace("stars")) {
library(ggplot2)
library(stars)
ggplot() +
geom_fields(
data = seawatervelocity,
mapping = aes(radius = as.numeric(v),
angle = as.numeric(angle),
col = as.numeric(v)),
## You can provide the `angle_correction()` as argument explicitly
## (it is already the default). Note that the plotted region requires
## hardly any correction for the angles.
.angle_correction = angle_correction)
}
Run the code above in your browser using DataLab