Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Hating learning R any advice for a perl guy?

by kevbot (Vicar)
on May 18, 2017 at 06:22 UTC ( [id://1190515]=note: print w/replies, xml ) Need Help??


in reply to Hating learning R any advice for a perl guy?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190515]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-03-29 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found