[R] call perl

Greg Snow Greg.Snow at imail.org
Fri Aug 22 18:29:50 CEST 2008


> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Jay an
> Sent: Thursday, August 21, 2008 8:08 PM
> To: r-help at r-project.org
> Subject: [R] call perl
>
> Hi,
>
> It may be the old question.
> can anyone tell me how to call perl in R?



> # call perl in R
> cat('Here perl, here perl, come here perl\n')



Ok, more seriously it can depend on what you want to do with Perl.

You can use the system or shell command to run any external program including perl.

You can open up a pipe connection to send info to or get info from external programs including perl.

There is the Rsperl interface (http://www.omegahat.org/RSPerl/)

The book S Poetry (http://www.burns-stat.com/pages/spoetry.html) has a 'perl' function that will run perl commands on a character vector (takes care of the exporting/importing for you).

If you just want Perl for the regular expressions, there are R functions such as regexpr that can use Perl regular expressions directly inside of R (link to pcre).

There may be other options, which is best depends on what you want perl to do for you.

Hope this helps,


> thanks
>
> Y.
>
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111



More information about the R-help mailing list