Dear R users,

I am trying to call a Perl subroutine from R . The subroutine returns an
arrray contaning three elements wihch are all strings. But the calling in R 
return an integer which is 0. I have no idea how this could happen. Maybe
becasue I shouldn't use system() in R or I should load a particular package
for my R in windows. Please help ....

-------------------------------------------------------------------
the perl subroutine in presentPerformance.pl

sub findAccuracy{
        while(defined($filename=glob("*.log"))){
        
        open(WORDLIST , $filename)||die("can't open the file!");
        while($line=<WORDLIST>){
                
            if ($line=~m/accuracy/){
          $line=~s/-----accuracy://;
           
@temp=split(" ",$line);
$temp[0]=~s/\%//; 
$temp[2]=~s/\%//;  
@accInfoList=($temp[0],$temp[2],$filename);
                
            }
           
        }       
        
        
}
return(@accInfoList)

}


findAccuracy();
----------------------------------------------------------------------------------------
The R code 

> class(system("perl presentPerformance.pl"))
[1] "integer"




regard,
Shu-Kai Chang
-- 
View this message in context: 
http://www.nabble.com/conversion-of-data-structure-between-R-and-Perl-tp19189221p19189221.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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