Lately, I seem to be using R about as much as Perl. I like both languages, but they are quite different. I have found that programming in R has influenced how I write Perl and vice versa.

I think one of the biggest advantages of R is that spreadsheet-like data is supported with a native data structure, i.e. a data.frame.

Certain modules make using Perl much more pleasant/efficient (e.g. Moose, Path::Tiny, etc.). The same goes for R. I find that I routinely use certain CRAN packages such as data.table, ggplot2, dplyr, reshape2, etc.

When I encounter a task that involves spreadsheet-like data, I tend to go to R; however, there are times I want to stick with Perl. In these cases, I tend to use the Data::Table module (which is heavily influenced by R). I do sometimes wish that more R-like things would make their way back into Perl. For example, Python has a port of ggplot2, while I don't think Perl has such a thing.

Also, there are some things that you can do in R to make things more perl-like. For example, most of the built-in regular-expression functions in R (such as gsub, grep, and grepl) take an argument perl = TRUE which will enable Perl-compatible regexps.

I tend to dislike IDEs, so I don't always use Rstudio when programming in R. I'll often use vim and run scripts with Rscript. If you are a vim user, you may want to enable vim keybindings in Rstudio (in Preferences->Editing->Keybindings).

So, my advice would be to find packages that you like. Perhaps you could find some problems and implement solutions in both R and Perl. That way you might start to see the strengths of both languages...and hopefully make working with R more pleasant.


In reply to Re: Hating learning R any advice for a perl guy? by kevbot
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.