Hi everyone,
I have this situation:
BC_partes = function(w) {
ifelse(w < 12.38 & w >= 0, 0.3806,
ifelse(w >= 12.38, 0.0921 + ((0.2885)/((0.0808*w)^0.4330))))
}
library(ggplot2)
library(dplyr)
DF <- data.frame(Xval = seq(0, 1500, 10), Yval = funcao_partes(seq(0, 1500,10)))
ggplot(data = DF, mapping = aes(x = Xval, y = Yval)) + geom_point()+
geom_line(data = filter(DF, Xval < 12.38 & Xval >= 0, color = 'green')) +
geom_line(data = filter(DF, Xval >= 12.38, color = 'red'))
Whe i run this code, this mensage apear:
Error in ifelse(w >= 12.38, 0.0921 + ((0.2885)/((0.0808 * w)^0.433))) :
missing "no" argument, no default.
What i need to do?