## Chunk 1
|
|||
x = 10
|
|||
## Chunk 2
|
|||
`_foo` = 10
|
|||
## Chunk 3
|
|||
x = 1:10
|
|||
## Chunk 4
|
|||
mean
|
|||
## Chunk 5
|
|||
methods("mean")
|
|||
## Chunk 6
|
|||
length(NULL)
|
|||
## Chunk 7
|
|||
typeof(NA)
|
|||
## Chunk 8
|
|||
is.na("NA")
|
|||
## Chunk 9
|
|||
y = 1/0
|
|||
## Chunk 10
|
|||
typeof(y)
|
|||
## Chunk 11
|
|||
is.integer(y)
|
|||
## Chunk 12
|
|||
1:3
|
|||
## Chunk 13
|
|||
x = c(1,2,3,4)
|
|||
## Chunk 14
|
|||
c(1, 3:5)
|
|||
## Chunk 15
|
|||
sum(numeric())
|
|||
## Chunk 16
|
|||
a = sqrt(2)
|
|||
|
|||
## Chunk 18
|
|||
set.seed(123)
|
|||
## Chunk 19
|
|||
y=sample(letters[1:5], 20, rep=T)
|
|||
## Chunk 20
|
|||
z= ordered(y)
|
|||
## Chunk 21
|
|||
y = list(a=1, 17, b=4:5, c="a")
|
|||
## Chunk 22
|
|||
l2 = list(mn = mean, var = var)
|
|||
|
|||
## Chunk 24
|
|||
e1 = new.env(hash=TRUE)
|
|||
## Chunk 25
|
|||
e1 = new.env()
|
|||
## Chunk 26
|
|||
e1 = new.env()
|
|||
## Chunk 27
|
|||
rm(e1)
|
|||
## Chunk 28
|
|||
capabilities()
|
|||
## Chunk 29
|
|||
library("geneplotter")
|
|||
## Chunk 30
|
|||
class(cars)
|
|||
## Chunk 31
|
|||
head(cars)
|
|||
## Chunk 32
|
|||
colSums
|
|||
## Chunk 33
|
|||
get("+")
|
|||
## Chunk 34
|
|||
x=1:4
|
|||
## Chunk 35
|
|||
"%p%" = function(x, y) paste(x, y, sep="")
|
|||
## Chunk 36
|
|||
myl = list(a1 = 10, b=20, c=30)
|
|||
## Chunk 37
|
|||
x= 11:20
|
|||
## Chunk 38
|
|||
x= 1:10
|
|||
## Chunk 39
|
|||
x=1:5
|
|||
## Chunk 40
|
|||
(letters[1:10])[c(TRUE, FALSE, NA)]
|
|||
## Chunk 41
|
|||
x=matrix(1:9,nc=3)
|
|||
## Chunk 42
|
|||
x[,1,drop=FALSE]
|
|||
|
|||
## Chunk 44
|
|||
x=array(1:27, dim=c(3,3,3))
|
|||
## Chunk 45
|
|||
x[1:3] = 10
|
|||
## Chunk 46
|
|||
x=1:10
|
|||
|
|||
## Chunk 48
|
|||
x=matrix(1:10, nc=2)
|
|||
## Chunk 49
|
|||
x= 11:15
|
|||
## Chunk 50
|
|||
nchar(month.name)
|
|||
## Chunk 51
|
|||
1:10 + 1:3
|
|||
## Chunk 52
|
|||
1:3 + numeric()
|
|||
## Chunk 53
|
|||
x = 1:4
|
|||
## Chunk 54
|
|||
names(x) = letters[1:4]
|
|||
|
|||
## Chunk 56
|
|||
Map(paste, 1:4, letters[1:4], sep="_")
|
|||
## Chunk 57
|
|||
set.seed(123)
|
|||
## Chunk 58
|
|||
sq1 = function(x) return(x*x)
|
|||
|
|||
## Chunk 60
|
|||
for(i in 1:3) print(i)
|
|||
## Chunk 61
|
|||
x = matrix(1:10, nc=2)
|
|||
## Chunk 62
|
|||
centre = function(x, type) {
|
|||
|
|||
|
|||
## Chunk 65
|
|||
## { top = options(show.error.messages=FALSE)
|
|||
## Chunk 66
|
|||
foo = function(x) {
|
|||
## Chunk 67
|
|||
FNFcondition = function (message, call = NULL){
|
|||
## Chunk 68
|
|||
## tryCatch(repeat(readline()),
|
|||
## Chunk 69
|
|||
downloadWithRestarts = function(url, destfile, ...){
|
|||
## Chunk 70
|
|||
## withCallingHandlers(downloadWithRestarts("http://foo.bar.org", "xyz"),
|
|||
## Chunk 71
|
|||
even = function(i) i %% 2 == 0
|
|||
## Chunk 72
|
|||
find("+")
|
|||
## Chunk 73
|
|||
assign("+", function(e1, e2) print("howdy"))
|
|||
## Chunk 74
|
|||
library(tools)
|
|||
## Chunk 75
|
|||
b = get("foo")
|
|||
## Chunk 76
|
|||
print("a")
|
|||
## Chunk 77
|
|||
x=expression(1:10)
|
|||
## Chunk 78
|
|||
e = new.env()
|
|||
## Chunk 79
|
|||
gg = local({
|
|||
## Chunk 80
|
|||
loadedNamespaces()
|
|||
## Chunk 81
|
|||
foo = function() {
|
|||
## Chunk 82
|
|||
bar2 = function(x) x + z
|
|||
## Chunk 83
|
|||
Rmlfun =
|
|||
## Chunk 84
|
|||
efun = Rmlfun(1:10) # efun is a function!
|
|||
## Chunk 85
|
|||
Rmklike =
|
|||
## Chunk 86
|
|||
newton = function(lfun, est, tol = 1e-7, niter = 500) {
|
|||
## Chunk 87
|
|||
e1 = new.env()
|
|||
## Chunk 88
|
|||
e1$a = 20
|
|||