Re: [R] Question about example function

2011-06-05 Thread Ethan Brown
Hi Abhilash, >From ?example, under "arguments": local: logical: if ‘TRUE’ evaluate locally, if ‘FALSE’ evaluate in the workspace. So all you need to do is: > x <- 0 > example(mean, local=TRUE) mean> x <- c(0:10, 50) mean> xm <- mean(x) mean> c(xm, mean(x, trim = 0.10)) [1] 8.75 5.50 mean> m

[R] Question about example function

2011-06-05 Thread Abhilash Balakrishnan
Dear Sirs, I am exploring the R package and its documentation. I find there is the function example which runs examples from documentation pages. What confuses me is that running example interferes with the variables I have in my workspace. > x <- 0 > example(mean) > x Now x is a vector of some