version.time: Run script in different versions of R and capture system...

Description Usage Arguments Examples

View source: R/version.time.R

Description

Run script in different versions of R and capture system time.

Usage

1
version.time(rVersions, expr, file)

Arguments

rVersions

Character vector containing path to Rscript in different installations of R

expr

Expression to evaluate

file

If specified, evaluates the code in the file, rather than expr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Find installed versions of Rscript

rversion <- paste(R.version$major, R.version$minor, sep = ".")
rscript <- findRscript(version = rversion)

# Configure which installed version to use

# Compute vector mean in different R installations

version.time(rscript, {
  set.seed(1)
  foo <- rnorm(1e4)
  mean(foo)
})


# Compute matrix cross product in different R installations

version.time(rscript, {
  set.seed(42)
  m <- matrix(runif(100), nrow=10)
  crossprod(m)
})

andrie/version.compare documentation built on Oct. 30, 2017, 9:41 p.m.