projects
/
profile
/
ivi
/
swig.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Upstream version 1.3.40
[profile/ivi/swig.git]
/
Examples
/
r
/
simple
/
runme.R
1
# file: runme.R
2
3
dyn.load(paste("example", .Platform$dynlib.ext, sep=""))
4
source("example.R")
5
cacheMetaData(1)
6
7
# Call our gcd() function
8
9
x <- 42
10
y <- 105
11
g <- gcd(x,y)
12
sprintf("The gcd of %d and %d is %d", x, y, g)
13
14
# Manipulate the Foo global variable
15
16
# Output its current value
17
Foo()
18
19
# Change its value
20
Foo(3.1415926)
21
22
# See if the change took effect
23
Foo()
24