CEBL
2.1
|
#include <RController.hpp>
Public Member Functions | |
RController () | |
~RController () | |
bool | start () |
void | stop () |
bool | isConnected () |
void | sendCommand (string command, bool clear=true) |
string | getResponse () |
ublas::matrix< double > | readMatrixFromTempFile () |
void | writeMatrixToTempFile (ublas::matrix< double > mat) |
Definition at line 32 of file RController.hpp.
RController::RController | ( | ) |
Definition at line 17 of file RController.cpp.
RController::~RController | ( | ) |
Definition at line 27 of file RController.cpp.
string RController::getResponse | ( | ) |
Get a raw response from the R process. This function will block until R prompt has been encountered from standard output.
Definition at line 195 of file RController.cpp.
Referenced by main().
|
inline |
ublas::matrix< double > RController::readMatrixFromTempFile | ( | ) |
Reads matrix written to tempfile. Use f token in sendCommand to send temporary filename to R.
Definition at line 271 of file RController.cpp.
void RController::sendCommand | ( | string | command, |
bool | clear = true |
||
) |
Sends a command to R. This function will not block. Since we are using pipes, there's no way of knowing when R finishes processing a command.
NOTES:command can contain a few token that will be replaced before sending to R:
f - generate a temporary filename
command | R command |
Definition at line 173 of file RController.cpp.
Referenced by main().
bool RController::start | ( | ) |
Starts R process and connects pipes Returns success.
Definition at line 117 of file RController.cpp.
Referenced by main().
void RController::stop | ( | ) |
void RController::writeMatrixToTempFile | ( | ublas::matrix< double > | mat | ) |
Writes a matrix to a file which can later be read by R using f token in sendCommand.
mat |
Definition at line 276 of file RController.cpp.
References cppR::writeTable().
Referenced by main().