2.
1 | c(1,2,3) |
3.11
((-27)*12)/21
3.21
sqrt(10)
3.31
log(10)
3.41
log10(2+3*pi)
3.51
exp(2.7689)
3.61
(25-5)^3
3.71
cos(pi)
3.8.11
prod(2:3)
3.8.21
10*9*8*7*6*5*4
3.8.31
(10*9*8*7*6*5*4)/(40*39*38*37*36)
3.9.11
choose(5,2)
3.9.21
choose(7,3)
4.rep1
2a=c(1,2)
rep(a,2)
4.seq1
seq(from=1,to=10,by=2)
4.matrix1
2data=c(1,2,3,4,5,6,7,8)
matrix(data,nrow=4,ncol=2,byrow=T)
5.11
dnorm(1)
5.21
qnorm(0.95)
5.31
rpois(100,5)
5.41
rnorm(100,60,10)
6.1
2x=c(rnorm(100,0,1))
print(x)
1 | print(sum(x)) |
7.1
2x=seq(1,10,1)
plot(x,exp(x))
7.21
2
3x=runif(100,1,10)
print(x)
hist(x)
8.1
library(MASS)
9.1
2
3
4
5
6ID=c('01','02','03')
class=c(1,2,3)
body_long=c(188,189,190)
weight=c(66,67,65)
df=data.frame(ID,class,body_long,weight)
print(df)
10.1
2print(df[,2])
print(df[2,2])
11.1
2data0=read.csv('path+1.csv')
data1=read.table('path+1.txt',header=F)