I vaguely recall thinking with such convoluted constructs when switching from Matlab to R. The lack of generic data structures such as lists makes you define variable names that you can identify and manipulate. There are structures in Matlab, but I think they are much less used than lists in R.

I was wondering earlier how to help newcomers understand the limitations of this strange and unnecessary construct without going through the details of each particular example that comes up in the r- help list. Perhaps a simple generic and illustrative example in the R wiki? (say, (i) list some data files in a directory, (ii)load into data.frames, (iii)manipulate some columns, (iv)store in a list, (v)manipulate the list, (vi)plot some results).

Now, how would we go about naming that entry...? Perhaps 'A beginner's assignment'


baptiste


On 20 Apr 2009, at 22:44, Stavros Macrakis wrote:

Judging from the traffic on this mailing list, a lot of R beginners
are trying to write things like

     assign( paste( "myvar", i), ...)

where they really should probably be writing

     myvar[i] <- ...

Do we have any idea where this bizarre habit comes from?

         -s

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

_____________________________

Baptiste AuguiƩ

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to