Hello!
I work with bioacoustics and am trying to create a graph of means by species using the lineplot.CI function of the sciplot package, but I can not get the R to ignore the missing values (NA). When I graph the durations of notes, everything is fine because the DeltaTime variable does not include NAs:
library(sciplot)
# Note duration
lineplot.CI(dados$especie, dados$DeltaTime, las=1, type="p",
xlab="Espécie", ylab="Duração nota", main="Duração nota",
ci.fun= function(x) c(mean(x)-sd(x), mean(x)+sd(x)))
WhenItrytousethesamefunctionforthePeakFreqvariable,ontheotherhand,thestandarddeviationbarsonlyappearforthespeciesthatdoesnothaveanyNA:lineplot.CI(dados$especie,dados$PeakFreq,las=1,type="p",
xlab="Espécie", ylab="Frequência dominante", main="Frequência
dominante",
ci.fun= function(x) c(mean(x)-sd(x), mean(x)+sd(x)))
I have tried to change the function in several ways and I searched a lot on the internet, but I did not succeed. Any ideas how to fix this?
obs: The function has no problem ignoring NAs when we consider only the default error