[R] applying uniroot function to each element in vector

Dale anthony_91 at optusnet.com.au
Wed Apr 27 17:54:41 CEST 2011

If I have a vector of n elements, e.g. a vector of length 4 with elements 10,
20, 30, 40 and want to find the different values of x such that x^2=10,
x^2=20, x^30 and x^2=40, how could I do this in R? I'm thinking of using the
uniroot function, but am finding difficult applying it to a vector. Thanks

View this message in context: http://r.789695.n4.nabble.com/applying-uniroot-function-to-each-element-in-vector-tp3478573p3478573.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list