|
Functions by Category Functions by Alphabetical list
This function passes the string contained within quotes to the R environment where it is executed, if applicable results are returned. See RVar for more details on what datatypes are supported for conversion between Seer and R. Depending how and where the function is used it may be necessary to add parentheses around the string.
If R is not available in the current environment an error will be produced.
Examples:
#the variable $ans contains the result of 5+5
my $ans = R '5 + 5';
#sum numbers from both R and Seer
my $ans = 5 + R('9') + 7 - R('12');
#create a vector called car and plot the vector
R'
car <- c(3,1,2,4,4,2)
plot(car)
';
#One of the R example plots, plots a contor chart of the
#Maunga Whau Volcano
R '
# A prettier display of the volcano
x <- 10*(1:nrow(volcano))
y <- 10*(1:ncol(volcano))
image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
contour(x, y, volcano, levels = seq(90, 200, by = 5),
add = TRUE, col = "peru")
axis(1, at = seq(100, 800, by = 100))
axis(2, at = seq(100, 600, by = 100))
box()
title(main = "Maunga Whau Volcano", font.main = 4)
';
Related functions: RVar
|