Professional Documents
Culture Documents
PG Data Science With R April 2021 - Assignment 1
PG Data Science With R April 2021 - Assignment 1
Please note:
If the code has error, Print “Error” as answer.
Else print the answer/output.
Questions can have more than one correct answer in MCQ
Q1.
x=8
print x
Answer output is: [1] "a" "b" "c"
Q2
x<-y<-6
print(x)
Answer output is:[1] 6
Q3
b=7
a<-6<-b
Answer: Error in 6 <- b : invalid (do_set) left-hand side to
assignmen
Q4
d=15
a<-c<-d
print (a)
Answer output is:[1] 15
Q5
x<-y< -5
print(x)
Answer output is[1] 5
Q6
Which of the below are invalid
Q8
What is the output of the following statements?
15/4 #output: [1] 3.75
Q9
b=100
print(type(b) )
Answer output:#Error in type(b) : could not find function type
Q10
c<- 123
print((typeof(b)) # output: double
Q12.
Which of the following is incorrect?
s1='a'
s2="a"
s3='add'
s4="add"
Q13.
What is the output
s5<-"Hello" #Error: unexpected symbol
s6="C" # invalid
Q14
What is the output of
data()
Answer: : returns all the data set available in the R.
Q15
What is the output of
help("bar") Answer error should be: ?(bar)
apropos("bar") Answer:
#> apropos("bar")
[1] "barplot" "barplot.default" "
?bar TRUE bartlett.test" "getTxtProgressBar"
[5] "getWinProgressBar" "setStatusBar" "
setTxtProgressBar" "setWinProgressBar"
[9] "txtProgressBar" "winProgressBar"
Q16
Write a program that prints the sequence Answer:
n<-c(1:100)
for (n in nums){
3,6,9,12,15,18,21,24,27,33,36.... if ((n %% 3 == 0) &
(n%%10 != 0)) {
Multiples of 3 except ones ending with 0. print(n)
} else {
}
}
Q17
Which of the following is not an advantage of R
a. jIDE
b. RStudio
c. Jupyter Notebook
d. aRcade
Answer: b
Q19
Which of the following skills is not needed for a data
scientist?
a. Strong Unix admin skills
b. Sugar coating and exaggerating facts Anwer: b