गुरुर्ब्रह्मा गुरुर्विष्णु गुरुर्देवो महेश्वरा गुरुर्साक्षात परब्रह्म तस्मै श्री गुरवे नमः !
1. Select all tools required for building a data science project*
Transform
Visualize
statistics
tidy
analysis
2. CRAN is a*
R Community
a central software repository
a library
R package
3. define the class of vector X<-c(1, “a”, TRUE)*
character
numeric
logical
factor
4. consider a vector X<-c(“jan”,”feb”,”march”,”april”,”may”) and a vector Y<-X[c(TRUE,FALSE,TRUE,FALSE, FALSE)]. What will will the output of print(Y).*
[1] “jan” “march” “may”
[1] “jan” “march”
[1] “feb” “april” “may”
[1] “march” “april “may”
5. what will the output of X<-V1*V2 where V1<-c(1,2,3,4) and V2<-c(1,2)*
[1] 1 4 3 8
[1] 2 4 4 6
error in code
[1] 0 0 2 2
6. consider a list, list1<- list(“Sam”, “Green”, c(8,2,67), TRUE, 51.99, 11.78,FALSE). what will be the output of list1[[3]][1]*
[1] “Green”
[1] 8 2 67
ERROR
[1] 8
7. Which of the following is a non-homogeneous data structure in R*
vector
list
matrix
array
8. consider a data frame named emp.data (below), what will be the output of emp.data[2:3,2]*
2 2 Rob Marketing
[1] “Marketing” “HR”
[1] “Rob” “Max”
3 3 Max HR
9. consider emp.data data frame as in above question. how can we add a new column/variable to the existing data frame*
emp.data%>%salary<-c(30000,20000,40000,50000)
emp.data$salary<-c(30000,20000,40000)
emp.data$salary<-c(30000,20000,40000,50000)
emp.data&salary<-c(30000,20000,40000,50000)
10. __________ used to categorize unique values in columns called “levels”*
Factor
Data frame
Matrix
List
11. An array is a ___________ data structure in R*
two-dimensional
one- dimenstional
multi-dimensional
none of the above
12. what will be the output of code:*
[1] 1 [1] 1.414214 [1] 1.732051 [1] 2 [1] 2.236068
[1] 1 [1] 2 [1] 3 [1] 4 [1] 5
[1] 1.732051 [1] 1.414214 [1] 1.732051
1 4 6 16 25
13. command to a load a package to current R environment is:*
library(package_name)
install.packages(“package_name”)
installed.packages(“package_name)
load(package_name)
14. Select all packages included in “tidyverse” package*
dplyr
purrr
readxl
ggplot2
MySQL
tibble
tidyr
15. consider M1 <- matrix(c(1:9), nrow = 3, ncol =3, byrow= TRUE), what will be the output of M1[2,]*
[1] 4 5 6
[1] 1 2 3
[1] 7 8 9
[1] 2 4 6
ASSIGNMENT-1