version 1.10, 2009/09/02 14:13:16
|
version 1.11, 2014/11/19 21:14:47
|
Line 53 sub Rcroak {
|
Line 53 sub Rcroak {
|
# |
# |
sub Rpeel { |
sub Rpeel { |
my $x = $_[0]; # the string containing the serialized R object(s) |
my $x = $_[0]; # the string containing the serialized R object(s) |
if ($x =~ /^((?:i|d):(.+?);)(.*)$/) { |
if ($x =~ /^N\;(.*)$/) { |
|
return ('',$1); |
|
} elsif ($x =~ /^((?:i|d):(.+?);)(.*)$/) { |
return ($1, $+); # x starts with a number |
return ($1, $+); # x starts with a number |
} elsif ($x =~ /^s:(\d+):/) { |
} elsif ($x =~ /^s:(\d+):/) { |
my $n = $1; # x starts with a string of length n |
my $n = $1; # x starts with a string of length n |
Line 147 sub Rreturn {
|
Line 149 sub Rreturn {
|
} |
} |
if ($errormsg) { return $errormsg; } |
if ($errormsg) { return $errormsg; } |
return \%h; # return a reference to the hash |
return \%h; # return a reference to the hash |
|
} elsif ($x eq '') { |
|
return ''; |
} else { |
} else { |
return 'Unrecognized output'; |
return 'Unrecognized output'; |
} |
} |