TP 2: Data structures in R
y <- matrix(45:64, nr=5, byrow=TRUE)
> y[1,] > y[3:4,3:4] > y[-c(2,3),-c(1,4)] > cbind(y,c(2,3,5,8,13))
sum(),
prod(),
t(),
sqrt(),
log(),
apply(),
min(),
max(),
sort(),
paste(),
rank(),
which(),
length(),
print().
Reminder : a matrix
(
from
to
,
from
to
) of size
,
is symetric if it is equal to its transpose, i.e. :
> z <- factor(c(0,1,1,0,0,1,1))
> levels(z) <- c("malade","saine")
> z
f <- factor(c(0.1,0.9,3.14,1.618,0.5,1))
> a <- list(valeurs=rep(c(1,2),3), motif=c("acgt","tgca") )
> a[[1]] > a[[2]][2] > a$motif > a$valeurs[3]
list("HeLLO",32,"every",3.14,"body","yeah"), the function should return 2.