warnings when using the PlotSticks

Hi- I am needing some assistance. I am using the plotSticks function to create wind vectors from wind speed and direction. I have plotted the water level for a month but when I try to run the plotSticks() function, I get this warning message:

Set wokring directing to folder where data is stored

setwd("/Users/marybrandonscott/Desktop/GY 516/GY516")
read.csv("DI2.csv")
di<-read.csv("DI2.csv")
u<-di[["u"]]
v<-di[["v"]]
w<-di[["w"]]
xt<-di[["dt"]]
t<-convertToDateTime(xt, origin="1900-01-01")
oce.plot.ts(t,w)
plotSticks(t,0.0,u,v,yscale = 10, add = TRUE)
There were 50 or more warnings (use warnings() to see the first 50)

warnings()
Warning messages:
1: In doTryCatch(return(expr), name, parentenv, handler) :
zero-length arrow is of indeterminate angle and so skipped

Does any one know how to fix this? I have tried changing the yscale.

Hi @mbscott,
These are warnings, not errors, so your plot should still be produced.
I suspect you have some zero or NA values in your dataframe, probably in the di$u or di$v columns. Consequently, R doesn't know which way to plot some of the arrows.

HTH

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.