History: Profile_r_test4_export
Source of version: 6
Copy to clipboard
{maketoc} !# Testing that basic R works {CODE()} {R()}1:10{R} {CODE} {R()}1:10{R} -==- !# Testing that basic plotting works {CODE()} {R()}x<-c(1:10) y <- x*x plot(x,y) {R} {CODE} {R()}x<-c(1:10) y <- x*x plot(x,y) {R} -==- !# Testing with security parameter !!# No security param set, 1 banned command (png) used By default security param is 1 (TRUE), so that checking banned params for security is performed. {CODE()} {R()}x<-c(1:20) y <- x*x png(filename = "temp/mytest_20.png"); plot(x,y) {R} {CODE} {R()}x<-c(1:20) y <- x*x png(filename = "temp/mytest_20.png"); plot(x,y) {R} -==- !!# Security param explicitly = 1 & 1 banned command (png) used Same behavior as before (no explicitly setting the security param) is expected: the command should be banned. {CODE()} {R(security=1)}x<-c(1:30) y <- x*x png(filename = "temp/mytest_30.png"); plot(x,y) {R} {CODE} {R(security=1)}x<-c(1:30) y <- x*x png(filename = "temp/mytest_30.png"); plot(x,y) {R} -==- !!# Security param explicitly = 0 & 1 banned command (png) used Forced mode to disallow security checking, so that banned commands can be executed. {CODE()} {R(security=0)}x<-c(1:40) y <- x*x png(filename = "temp/mytest_40.png"); plot(x,y) {R} {CODE} {R(security=0)}x<-c(1:40) y <- x*x png(filename = "temp/mytest_40.png"); plot(x,y) {R} -==- !!# Security param explicitly > 1 & 1 banned command (png) used Since security param is not zero, security checking should be applied. {CODE()} {R(security=2)}x<-c(1:50) y <- x*x png(filename = "temp/mytest_50.png"); plot(x,y) {R} {CODE} {R(security=2)}x<-c(1:50) y <- x*x png(filename = "temp/mytest_50.png"); plot(x,y) {R}