Site icon R-bloggers

Typo in Chapter 5

[This article was first published on Xi'an's Og » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Gilles Guillot from Technical University of Denmark taught a course based on our R book and he pointed out to me several typos in Chapter 5 of “Introducing Monte Carlo Methods with R”:

I checked the last item with the new version of R and got the following confirmation that optimise does not accept (any longer) the abbreviation of its arguments…

demo(Chapter.5)
————————

Type  <Return>   to start :

> # Section 5.1, Numerical approximation
>
> ref=rcauchy(5001)

> f=function(y){-sum(log(1+(x-y)^2))}

> mi=NULL

> for (i in 1:400){
+   x=ref[1:i]
+   aut=optimise(f,interval=c(-10,10),max=T)
+   mi=c(mi,aut$max)
+   }
Error in f(arg, …) : unused argument(s) (max = TRUE)

> optimise(f,interval=c(-10,10),maximum=T)
$maximum
[1] -2.571893

$objective
[1] -6.661338e-15


Filed under: Books, R, Statistics Tagged: birthday, Gilles Guillot, Introducing Monte Carlo Methods with R, optimise, R 2.11.1, R syntax, typo
To leave a comment for the author, please follow the link and comment on their blog: Xi'an's Og » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.