Your skill will accomplish
what the force of many cannot
Re: Calling R in perlby blackzero (Acolyte)
|on Dec 17, 2012 at 13:24 UTC||Need Help??|
OK. Statistics::R seens to be working fine now
I just ignores the error message in the test and went ahead with the installation, just as was told me in here: http://www.perlmonks.org/?node_id=1009156
But still I have two problems (that I hope are the last ones).
First of all, when I try to pass my table from perl to R with the comand "$R -> set( 'table', \@lines );", it returns this error:
I scaped that creating an output file from perl (named "data_freq.txt.out" and telling R to import from that. But this doesnt seens the right way to do it.
Second. When I try to return a table from R to perl, importing it to an array (in "my @results1 = $R->get('g1');"), I would like all the values in the table to be passed to this array (@results1). So I could shift and pop values from that array to use in other perl things (Mostly to create an nice output file)
Instead, what I get is an array with a single element that is some kind of octodecimal value (I guess)
How can I fix that?
Someone already told me to use "$results1" instead of "@results1". But that gives me the same output. Besides, it will create an scalar and that is not what I want
NOTE: "my $media = $R->get('meang1');" do work! I guess thats is because its a single value.
HERE are my codes, wich I call with "./perl-R4.pl data_freq.txt"