// -*- Mode:C++; Coding:us-ascii-unix; fill-column:160 -*-
/**************************************************************************************************************************************************************/
/**
@file      riHello.cpp
@author    Mitch Richling <https://www.mitchr.me>
@Copyright Copyright 2015 by Mitch Richling.  All rights reserved.
@brief     Just about the simplest RInside program you can have.@EOL
@Keywords  rinside examples r cran package c++ hello world
@Std       C++11
*/

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <RInside.h>                                                     /* RInside                 R pkg    */
#include <ostream>                                                       /* C++ ostream             C++98/11 */

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[]) {

  RInside R(argc, argv);                               // create an embedded R instance

  std::cout << "Result of 1+1: " << std::endl; 
  R.parseEvalQ("cat(1+1)");                           // Feed a string to R, and get it evaluated
  std::cout << std::endl;                 

  exit(0);                                
}