[OGRUG] Report on May 24 meeting

Prof. John C Nash nashjc at uottawa.ca
Thu May 26 00:23:45 CEST 2011


While we had only a small group (8) at the meeting, discussion was lively and some minor
problems were resolved.

There was quite a lot of interest in the projects R is mentoring for the Google Summer of
Code. This year we have 15. There is a brief outline of the projects linked directly from
the main www.r-project.org page.

There were two pre-announced R coding questions.

David Joubert had an SPSS data file that he wanted to bring into R to either use in
creating a 5 dimensional frequency array or else convert to a numerical (rather than
character) raw data file of binary information on 5 symptom variables for 500 cases.

The foreign package can read the data into a data frame, but the binary variables are of
class factor. After the meeting a bit of playing showed that as.numeric() will convert
these to numbers (1, 2) and write.csv will write them in a form that is easily changed in
a spreadsheet to the form needed by some specialized software. It should in fact be
possible to avoid the last step by appropriate parameters to write.csv.

John Nash illustrated a concern for those working on optimization, differential equations
or quadrature when it is desired to record every function evaluation of a multivariate
function e.g., the objective in optimization. The issue is to avoid passing such
information through the optimizer, which may be compiled code and difficult to access.
While it should be possible to use environments, there seemed to be a general view that
this tended to be more tricky than anyone liked. However, we were able in a small example
to set a global object f.save to NULL, then use rbind inside the function to append the
vector c(f, x_vector). It was agreed this was NOT a good idea for inclusion in a package,
but likely the most straightforward tool for experimentation.

This lead to a discussion of the merits of using return() to end R functions, and a brief
attempt to test the speed of use of return(x) versus just ending with the evaluation of x
using the microbenchmark package. This was inconclusive for the simple example tried.

We hope to have a similar event in the Autumn with more problems pre-announced.

John Nash



More information about the R-UG-Ottawa mailing list