1 -
exeedence <- function(fx){
x <- 4:250
hx <- (log(x)-1)/(x^(1/2))
gx <- exp(hx^(1/2))
fx <- sin(gx)^(cos(gx))
plot(fx)
}
print(exeedence)
function(fx){
x <- 4:250
hx <- (log(x)-1)/(x^(1/2))
gx <- exp(hx^(1/2))
fx <- sin(gx)^(cos(gx))
plot(fx)
}
plot(exeedence)
Error in curve(expr = x, from = from, to = to, xlim = xlim, ylab = ylab, :
'expr' did not evaluate to an object of length 'n'
2 -
Exeed_func <- function(threshold) {
set.seed(1)
x <- runif(10, min = 0, max = 1)
x
threshold <- x > 0.8
if (threshold > 0.8 ) {
print ("ok")
} else {
print ("no good")
}
}
3 -
digitsum = function (x) {
x <- 385102
sum(as.numeric(unlist(strsplit(as.character(x), split=""))))
if (digitsum < 50) {
digitsum + 10
print ("is it ok?")
}
}