swig/Examples/r/simple/runme.R
Joseph Wang ef80a4f59a Committing R-SWIG
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9175 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-29 03:01:18 +00:00

24 lines
340 B
R

# file: runme.R
dyn.load('example_wrap.so')
source('example_wrap.R')
cacheMetaData(1)
# Call our gcd() function
x <- 42
y <- 105
g <- gcd(x,y)
sprintf("The gcd of %d and %d is %d", x, y, g)
# Manipulate the Foo global variable
# Output its current value
Foo()
# Change its value
Foo(3.1415926)
# See if the change took effect
Foo()