RInside Version 0.2.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rinside_sample0.cpp
Go to the documentation of this file.
1 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8; -*-
2 //
3 // Simple example showing how to do the standard 'hello, world' using embedded R
4 //
5 // Copyright (C) 2009 Dirk Eddelbuettel
6 // Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
7 //
8 // GPL'ed
9 
10 #include <RInside.h> // for the embedded R via RInside
11 
12 int main(int argc, char *argv[]) {
13 
14  RInside R(argc, argv); // create an embedded R instance
15 
16  R["txt"] = "Hello, world!\n"; // assign a char* (string) to 'txt'
17 
18  R.parseEvalQ("cat(txt)"); // eval the init string, ignoring any returns
19 
20  exit(0);
21 }
22 
void parseEvalQ(const std::string &line)
Definition: RInside.cpp:366
int main(int argc, char *argv[])