version 1.9, 2009/08/14 01:58:52
|
version 1.12, 2024/06/21 23:42:49
|
Line 33 use IO::Socket;
|
Line 33 use IO::Socket;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::response(); |
use Apache::response(); |
use LONCAPA; |
use LONCAPA; |
|
use Tie::IxHash::Easy; # autoties all subhashes to keep index order |
### You need to install the libraries below for this to work! |
use Data::Dumper; # used to output hash contents |
|
|
###use Tie::IxHash::Easy; # autoties all subhashes to keep index order |
|
###use Data::Dumper; # used to output hash contents |
|
|
|
my $errormsg=''; |
my $errormsg=''; |
|
|
Line 56 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 150 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'; |
} |
} |
Line 242 sub blacklisted {
|
Line 243 sub blacklisted {
|
} |
} |
|
|
sub r_allowed_libraries { |
sub r_allowed_libraries { |
return ('alr3','boot','car','class','cluster','datasets','Hmisc','KernSmooth','leaps','lmtest', |
return ('alr3','boot','car','class','cluster','datasets','FactoMineR','Hmisc','KernSmooth','leaps', |
'MASS','methods','mgcv','nlme','nnet','qAnalyst','quadprog','rpart','SuppDists','spatial', |
'lmtest','MASS','mdatools','methods','mgcv','nlme','nnet','qAnalyst','quadprog','rpart', |
'splines','stats','stats4','survival','tseries','zoo'); |
'SuppDists','spatial','splines','stats','stats4','survival','tseries','zoo'); |
} |
} |
|
|
sub r_is_allowed_library { |
sub r_is_allowed_library { |