Rcmd Handler
SummaryIncluded librariesPackage variablesDescriptionGeneral documentationMethods
Summary
  Rcmd::Handler - Internal class with miscellaneous interfaces to R language.
Package variables
No package variables defined.
Included modules
G::Messenger
SubOpt
Inherit
Exporter
Synopsis
No synopsis!
Description
 Intended for internal use only. Super class for the core. Provides 
 the native methods.
Methods
_installed_R_packages
No description
Code
_is_nominal
No description
Code
Methods description
None available.
Methods code
_installed_R_packagesdescriptionprevnextTop
sub _installed_R_packages {
    my $R_OUTPUT;

    # trap STDERR output from R
open TMPOUT, '>&', STDERR; close STDERR; open STDERR, '>',\$ R_OUTPUT; # call 'library()' method
my $rcmd= Rcmd->new(); $rcmd->exec('library()'); # re-open STDERR
close STDERR; open STDERR, '>&TMPOUT'; close TMPOUT; my @pkg_list; for my $line (split /\n/, $R_OUTPUT) { my ($pkg)= split /\s+/, $line; push @pkg_list, $pkg if $pkg; } return @pkg_list;
}
_is_nominaldescriptionprevnextTop
sub _is_nominal {
    return -1 unless $_[0];
    return -1 unless ref $_[0] eq 'ARRAY';

    my @array= @{+shift};
    return -1 unless $array[0];

    # array is continuous scale (0) or nominal scale (1)
my $is_nominal= 0; for (0 .. ($#array > 9 ? 9 : $#array)) { my $item= $array[$_]; next unless $item; if (($item ^ $item) eq '0') { # $item is number
next; } else { # $item is not number
$is_nominal = 1; # nominal scale
last; } } return $is_nominal;
}
General documentation
AUTHORTop
Kazuharu Arakawa, gaou@sfc.keio.ac.jp