/trunk/Examples/r/simple/runme.R

# · R · 24 lines · 10 code · 8 blank · 6 comment · 0 complexity · ef848e158c5bc047dffc8a4ca20a10df MD5 · raw file

  1. # file: runme.R
  2. dyn.load(paste("example", .Platform$dynlib.ext, sep=""))
  3. source("example.R")
  4. cacheMetaData(1)
  5. # Call our gcd() function
  6. x <- 42
  7. y <- 105
  8. g <- gcd(x,y)
  9. sprintf("The gcd of %d and %d is %d", x, y, g)
  10. # Manipulate the Foo global variable
  11. # Output its current value
  12. Foo()
  13. # Change its value
  14. Foo(3.1415926)
  15. # See if the change took effect
  16. Foo()