RInside Version 0.2.6
inst/examples/standard/rinside_sample0.cpp
Go to the documentation of this file.
00001 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4;  tab-width: 8; -*-
00002 //
00003 // Simple example showing how to do the standard 'hello, world' using embedded R
00004 //
00005 // Copyright (C) 2009 Dirk Eddelbuettel 
00006 // Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
00007 //
00008 // GPL'ed 
00009 
00010 #include <RInside.h>                    // for the embedded R via RInside
00011 
00012 int main(int argc, char *argv[]) {
00013 
00014     RInside R(argc, argv);              // create an embedded R instance 
00015 
00016     R["txt"] = "Hello, world!\n";       // assign a char* (string) to 'txt'
00017 
00018     R.parseEvalQ("cat(txt)");           // eval the init string, ignoring any returns
00019 
00020     exit(0);
00021 }
00022 
 All Classes Files Functions Variables Enumerations Enumerator Defines