dear all,

I am trying to implement some perl scripting in R to improve the performance
of some scripts.

I found RSPerl library, but it seems to be quite tricky to import variables.
this is a simple example.
is there any simpler way to do it?
furthermore is there any other available resource to interface the two
language? RSPerl seems to be no longer supported
and when I load it R complains about deprecated functions


perl_script <- function(x){
   Pvar <- "@var = 1;"
   PPvar <- .PerlExpr(Pvar)
   i = 1
   for(i in 1:length(x)){
      Ppush <- paste("push","(", "@var", ",", x[i], ")", ";", sep = "")
      .PerlExpr(Ppush)
      print(i)
   }
   Print <-  paste("print", "\"","@var", "\n","\"", ";", sep= "")
   .PerlExpr(Print)
}
aa = 1:10
out <- perl_script(aa)


thank you

        [[alternative HTML version deleted]]

______________________________________________
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