Alambic Perldoc

Description Alambic
Alambic Perldoc > Perl Modules > Alambic::Tools::R
Source

NAME

Alambic::Tools::R - A plugin to interact with the R engine.

DESCRIPTION

Alambic::Tools::R provides an interface to the R statistical engine. It specifically provides methods to compute R script files and knit R markdown documents.

For the complete configuration see the user documentation on the web site: https://alambic.io/Plugins/Tools/R.html.

new()

    my $tool = Alambic::Tools::R->new();
    $tool->test();

Build a new R tool object.

get_conf()

    my $conf = $r->get_conf();

Get configuration for this Git plugin instance.

version()

    my $version = $r->version();

Return R version as a string.

test()

    my $results = 

Self-test method for the tool.

    [
      'OK: R exec found in PATH at [/home/boris/applis/R-3.3.2/bin/R].',
      'OK: Rscript exec found in PATH at [/home/boris/applis/R-3.3.2/bin/Rscript].'
    ]

knit_rmarkdown_inc()

    my $log = $tool->knit_rmarkdown_inc('Hudson', 'test.project', 
      'hudson.Rmd', [], \%params);

Function to knit a rmarkdown document to a html snippet.

It goes into the plugin's directory, creates required directories (e.g. figures/) and executes Rscript. The plugin assumes that the input files needed are already present in the directory. Returns the log of the transformation.

    [
      '[Tools::R] Exec [Rscript -e "library(rmarkdown); project.id <- 
        \'test.project\'; plugin.id <- \'Hudson\'; rmarkdown::render(\'
        hudson.Rmd\', output_format=\'html_fragment\', output_file=
        \'test.project_hudson.inc\')"].',
      '[Tools::R] Moved main file from [lib/Alambic/Plugins/Hudson/
        test.project_hudson.inc] to [projects/test.project/output/]. ret [1].'
    ]

knit_rmarkdown_pdf()

    my $log = $tool->knit_rmarkdown_pdf('Hudson', 'test.project', 
      'hudson.Rmd', \%params);

Function to knit a rmarkdown document to a pdf document.

It goes into the plugin's directory, creates required directories (e.g. figures/) and executes Rscript. The plugin assumes that the input files needed are already present in the directory. Returns the log of the transformation.

knit_rmarkdown_html()

    $log = $tool->knit_rmarkdown_html('Hudson', 'test.project',
      'hudson_hist.rmd', [], \%params);

Function to knit a rmarkdown document to a full html document.

It goes into the plugin's directory, creates required directories (e.g. figures/) and executes Rscript. The plugin assumes that the input files needed are already present in the directory. Returns the log of the transformation.

knit_rmarkdown_images()

    $log = $tool->knit_rmarkdown_images('PmdAnalysis', 'test.project',
      'pmd_analysis_files_ncc1.r', ["pmd_analysis_files_ncc1.svg"]);

Function to knit a rmarkdown document to image(s).

It goes into the plugin's directory, creates required directories (e.g. figures/) and executes Rscript. The plugin assumes that the input files needed are already present in the directory. Returns the log of the transformation.

SEE ALSO

https://alambic.io/Plugins/Tools/R.html, https://www.r-project.org,

Mojolicious, http://alambic.io, https://bitbucket.org/BorisBaldassari/alambic