swig/Examples/r/simple/runme.R
William S Fulton dd80fda7bf changes for generated .R file name change
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10110 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-11-11 20:41:11 +00:00

24 lines
369 B
R

# file: runme.R
dyn.load(paste("example_wrap", .Platform$dynlib.ext, sep=""))
source("example.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()