having to learn R

Had to do the same a couple years ago. Initially tried to minimize my expose to R with Statistics::R but was frustrated with the limitations on types of data structures which could be passed back and forth. Wrote my first R scripts in a C/Perl style with for loops, which resulted in painfully slow execution. In the end, I basically abandoned my Perl mindset and embraced vectors and implied loops. Simple Perl constructs can be so awkward in R that, in my opinion, it might be better not to think about Perl at all when learning R.

Basically, R is an interactive tools which can be scripted ... but that's not really what it's made for. Data types can change unexpectedly (eg, a single-column matrix silently changes into a vector) and array indexing calls a function. The trick is to find the R way to do things since those call C-functions rather than pure R.

I currently code in Perl, Python and R on a regular basis. I occasionally get mixed up but treating R like the completely unrelated language it is helped reduce the frustration.


In reply to Re: Hating learning R any advice for a perl guy? by igelkott
in thread Hating learning R any advice for a perl guy? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.