could not find function "error.bar" Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval

Hello!
I just started using "R", so today I came across an issue that is could not find function "error. bar" notification is showing when I try to create an HTML markdown file, however when I tried to run the code chunk, It was working fine but even in the markdown script as well.
here is the code

Nhat_Count<-barplot(as.matrix(Nhat), main="least_count", 
                    ylab = "Numbers",ylim = c(0,450),las=3, 
                    cex.names=0.5,cex.lab = 1.5, cex.main = 1.4, 
                    beside=TRUE, col=c("grey","orange"))
text(Nhat_Count,as.matrix(Nhat)+100,
     labels=as.character(as.matrix(Nhat)))
legend("topleft", c("2018","2020"), 
       cex=1.3, bty="n", fill=c("grey","orange"))
EB_1<-matrix(c(W1$SD_1,W1$SD_2,W1$SD_3,W1$SD_4,W1$SD_5,W1$SD_6,W1$SD_7,W1$SD_8),2,8,byrow=TRUE)*1.96/sqrt(16)
error.bar(Nhat_Count,as.matrix(Nhat),EB_1)

please help

This means that the function does not exist in your current session.

  • where is it define in your script ?
  • Is this from a package ? Did you load it ?
  • Is there a typo in the function name ?

The message is rather clear, so you need to check what you want to do here.

  1. No, it isnt defined in my script
  2. not that i know of that if its from a package or not
    3.nope there isnt a typo
    i have followed this
    https://stackoverflow.com/questions/29768219/grouped-barplot-in-r-with-error-bars?rq=1
    format, so it worked in R and even in markdown script when i tried run the code chunks, but when i tried to create the html that time it was showing errors.

Sorry but i can't find the function error.bar on my R installation. ??error.bar
Where is it define ? in a package ? in your script ?
This function does not exist for me so I can't help more.

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