Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Import library #5

@omarciovsena

Description

@omarciovsena

I'm in need import libraries in my R code, but is giving the following error.

$rOutputParser = new ROutputParser();
$rProcess = $r->createInteractiveProcess();
$rProcess->start();
$resultado = "a";
$rProcess->write(<<<EOF
   require("sm",lib.loc="/Library/Frameworks/R.framework/Resources/library/")
EOF
        );
var_dump($rProcess->getErrors());

Result:

array (1) {
   [0] =>
   object (Kachkaev \ PHPR \ RError) # 77 (4) {
     ["inputLineNumber": "Kachkaev \ PHPR \ RError": private] =>
     int (0)
     ["commandNumber": "Kachkaev \ PHPR \ RError": private] =>
     int (0)
     ["command", "Kachkaev \ PHPR \ RError": private] =>
     string (90) "require (" sm "lib.loc =" / Library / Frameworks / R.framework / Resources / library / ")"
     ["errorMessage": "Kachkaev \ PHPR \ RError": private] =>
     string (97) "Loading required package: sm
Package 'sm', version 2.2-5.4: type help (sm) is summary information "
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions