swig/Examples/r/simple/runme.R
William S Fulton 6e9058cbeb Make examples cross platform
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10091 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-11-08 21:40:24 +00:00

24 lines
374 B
R

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