Documente Academic
Documente Profesional
Documente Cultură
[1,] 1 3 5 7 9
[2,] 2 4 6 8 10
x[,3]
[1] 5 6
2.
fruit <- c(5, 10, 1, 20) genereaza vectorul numit fruit cu urmatoarele elemente: 5, 10, 1, 20
> names(fruit) <- c("orange", "banana", "apple", "peach") creeaza atributele names pentru elementele
vectorului fruit:
5 10 1 20
> lunch <- fruit[c("apple","orange")] selecteaza coloanele cu numele apple si orange din fruit
>lunch va afisa:
apple orange
1 5
3.
>data(mtcars)
[1] 1 22
setdiff
function (x, y)
x <- as.vector(x)
y <- as.vector(y)
else x)
<bytecode: 0x0000000014d9ca28>
<environment: namespace:base>
5.
>A
[1,] 10 12 15 11
[2,] 8 9 7 13
[3,] 1 14 19 4
[4,] 2 3 5 9
[1,] 10 12 15 11
[2,] 8 9 7 13
[3,] 1 14 19 4
[4,] 2 3 5 9
> t(A)
col1 10 8 1 2
col2 12 9 14 3
col3 15 7 19 5
col4 11 13 4 9
6.
B=matrix(c(9,12,15,18,21,24,6,22.9,23.7,23.4,23.9,22.5,23.2,24.8,17.0,18.0,17.9,17.9,17.1,17.3,18.7),
nrow=7, ncol=3, dimnames=list(c("1 ora", "2 ora", "3 ora", "4 ora", "5 ora", "6 ora", "7 ora"),c("ora",
"tempinitial", "tempfinal")))
B1<-B[,1:2]
7.
>h<-c(22,30,27,21,30,20,26,25,30,21,21,23,24,23,24,30,19,20,21,22,23,25,23,21,25,26,27,28,29,30)
Main = Titlul