41
Which of the following code will drop the nth column?
A)
new <- old[-n,]
B)
new <- old[,-n]
C)
new <- old[,-c(i,j)]
D)
new <- subset(old,logical)
Answer & Solution
Answer: Option
A
42
Which of the following code drop the ith and jth column?
A)
new <- old[-n,]
B)
new <- old[,-n]
C)
new <- old[,-c(i,j)]
D)
new <- subset(old,logical)
Answer & Solution
Answer: Option
C
43
Which of the following statement find cases with no missing values?
A)
complete <- subset(data.df,complete.cases(data.df)
B)
complete <- sub(data.df,complete.cases(data.df)
C)
complete <- subset(data.df,completeall.cases(data.df)
D)
new <- old[n1:n2,n3:n4]
Answer & Solution
Answer: Option
A
44
Which of the following statement is normal distribution?
A)
dnorm(x, mean=0, sd=1, log = FALSE)
B)
pnorm(q, mean=0, sd=1, lower.tail = TRUE, log.p = FALSE)
C)
qnorm(p, mean=0, sd=1, lower.tail = TRUE, log.p = FALSE)
D)
rnorm(n, mean=0, sd=1)
Answer & Solution
Answer: Option
A
45
which of the following statement gives cumulative sum?
A)
cumsum(x,na=rm=TRUE)
B)
cumprod(x)
C)
cummax(x)
D)
cummin(x)
Answer & Solution
Answer: Option
A
46
Which of the following is uniform distribution?
A)
dunif(x, min=0, max=1, log = FALSE)
B)
punif(q, min=0, max=1, lower.tail = TRUE, log.p = FALSE)
C)
qunif(p, min=0, max=1, lower.tail = TRUE, log.p = FALSE)
D)
runif(n, min=0, max=1)
Answer & Solution
Answer: Option
A
47
Which of the following truncates real x to integers?
A)
as.order(x)
B)
as.integer(x)
C)
as.numeric(x)
D)
as.character(x)
Answer & Solution
Answer: Option
B
48
Which of the following tests each element of x for membership in y?
A)
y%in%x
B)
all(x)
C)
any(x)
D)
x%in%y
Answer & Solution
Answer: Option
D
49
Which of the following finds the maximum value in the vector x, exclude missing values?
A)
rm(x)
B)
max(x, na.rm=TRUE)
C)
all(x)
D)
x%in%y
Answer & Solution
Answer: Option
B
50
Which of the following produces the variance covariance matrix?
A)
sd(x, na.rm=TRUE)
B)
mad(x, na.rm=TRUE)
C)
fivenum(x, na.rm=TRUE)
D)
var(x, na.rm=TRUE)
Answer & Solution
Answer: Option
D