I'm new to R and I'm trying to store the value of the following function inside a vector in r. f(x) = 0.1e^x . cosx + 2ln|x| and I want to find the summation of this function when x = (2,2.1,2.2,...) my code so far is the following:
VecA <- c(function(x){
0.1*exp(x)*cos(x)+2*log(|x|)
})
Can someone please help me with this. Thanks in Advance!