Professional Documents
Culture Documents
Options Count
Which one creates a different output?
seq(5,by=1,length.out = 5) 62
score: 2
seq(6,10,by=1)
1
score: 0
6:10
0
score: 0
96.9%
seq(to=10,from=6)
1
score: 0
Options Count
Which one is the output of c(-2,6,3) + c(1,3,0,-1)
-1 9 3 -3 60
score: 2
-1 9 3 0
0
score: 0
-1 9 3 -1
2
score: 0
93.8%
-1 9 3 NA
2
score: 0
-1 9 3 -3 -1 9 3 -1 -1 9 3 NA
Options Count
Options Count
rep(-2:2,c(2,1,2,1,2))
54
score: 2
seq(-2:2,c(2,1,2,1,2))
7
score: 0
seq(2:-2,c(2,1,2,1,2))
0
score: 0
Which one creates the sequence -2 -2 -1 0 0 1 2 2 ? rep(-2:2,c(-2,-1,0,1,2))
3
score: 0
Options Count
10.9%
Graphical Representation Data
84.4%
Which one creates vectors Real.GDP and Nominal.GDP by using the table above?
Egypt 27 32
Options Count
Which one creates vectors Real.GDP and Nominal.GDP by using the
table above?
Real.GDP <- c(492,27,280,224)
Nominal.GDP <- c(495,32,291,251) 56
score: 2
9.4%
Real.GDP <- (492,27,280,224)
Nominal.GDP <- (495,32,291,251) 1
score: 0
Options Count
Which one gives names (Japan, Egypt, France, Brazil) to the vectors Real.GDP and Nominal.GDP?
Options Count
names(Real.GDP) <-
c("Japan","Egypt","France","Brazil")
names(Nominal.GDP) <- 64
c("Japan","Egypt","France","Brazil")
score: 2
names(Real.GDP) <-
c(Japan,Egypt,France,Brazil)
names(Nominal.GDP) <- 0
c(Japan,Egypt,France,Brazil)
score: 0
name(Real.GDP) <-
c("Japan","Egypt","France","Brazil")
name(Nominal.GDP) <- 0
c("Japan","Egypt","France","Brazil")
score: 0
Which one gives names (Japan, Egypt, France, Brazil) to the vectors
Real.GDP and Nominal.GDP? names(Real.GDP) <-
("Japan","Egypt","France","Brazil")
names(Nominal.GDP) <- 0
("Japan","Egypt","France","Brazil")
score: 0
Options Count
100%
Options Count
Which of the following sorts Real.GDP according to the Nominal.
GDP?
Real.GDP[order(Nominal.GDP)] 56
score: 2
10.9%
Nominal.GDP[sort(Real.GDP)]
0
score: 0
Nominal.GDP(order[Real.GDP])
1
87.5% score: 0
Real.GDP(sort[Nominal.GDP])
7
score: 0
According to this dePnition, which of the following gives the GDP deQator vector of countries Japan, Egypt, France
and Brazil?
Options Count
According to this definition, which of the following gives the GDP
deflator vector of countries Japan, Egypt, France and Brazil?
GDP.Deflator <- (Nominal.GDP /
Real.GDP)*100 61
score: 2
Options Count
Options Count
Which of the following includes numbers which have exactly 2
decimal places for the GDP.Deflator?
round(GDP.Deflator,2)
48
score: 2
21.9% signif(GDP.Deflator,2)
14
score: 0
75% trunc(GDP.Deflator,2)
1
score: 0
floor(GDP.Deflator)
1
score: 0
Which of the following creates GDP deQator groups "Low inQation" and "High inQation"?
Options Count
Which of the following creates GDP deflator groups "Low inflation"
and "High inflation"?
ifelse(GDP.Deflator<110,"Low
Inflation","High Inflation") 63
score: 2
min(GDP.Deflator,2)
0
score: 0
ifelse(sort(GDP.Deflator,2),"Low
Inflation","High Inflation") 1
score: 0
98.4%
GDP.Deflator[GDP.Deflator<110] <-
"Low Inflation" 0
score: 0
ifelse(GDP.Deflator<110,"Lo… ifelse(sort(GDP.Deflator,2),"L…
Options Count
Which one gives the names of the countries whose GDP deQator is less than 110?
Options Count
names(GDP.Deflator[GDP.Deflator<110])
58
score: 2
names(GDP.Deflator[GDP.Deflator>110])
1
score: 0
names(sort(GDP.Deflator<110))
2
score: 0
Which one gives the names of the countries whose GDP deflator is names(ifelse(GDP.Deflator<110,names))
less than 110? 3
score: 0
Options Count
90.6%
Which of the followings are TRUE for lists?
i.Lists can contain only one data type. ii.Double brackets are one of the ways to reach elements of the list. iii.To concatenate lists, vector notation is used.
Options Count
Which of the followings are TRUE for lists?
ii,iii
48
score: 2
15.6%
i,ii
2
score: 0
75% i,ii,iii
4
score: 0
ii
10
score: 0
Which of the following is the code that deletes the "Department" component from list and adds "ID" as the third
element of the list?
We have a list called "Student" whose elements are "Name", "Age", "Department"and "GPA" in order.
Options Count
Which of the following is the code that deletes the "Department"
component from list and adds "ID" as the third element of the list?
>Student$Department<-NULL
>Student<-
41
c(Student[c(1,2)],Id=...,Student[c(4:5)])
score: 2
28.1%
>Del(Student$Department)
>Student[[3]]<-c(ID=...) 3
score: 0
64.1%
>Student[["Department"]]<-NULL
>Student$ID<-c(...) 18
score: 0
>Del(Student$Department)
>Student$Department… >Del(Student$Depart… 1/2 >Student<-
2
c(Student[c(1,2)],Id=...,Student[c(4:5)])
score: 0
Options Count
We have a list that contains the grades of students, named Grades. Each element of the list corresponds to different courses. We want to learn the standard deviation of grades for
every course in a list format.
Options Count
Which code do we need to use?
lapply(Grades,sd)
62
score: 2
apply(Grades,var)
0
score: 0
sapply(Grades,sd)
1
score: 0
96.9%
lapply(Grades,var)
1
score: 0
Options Count
Which of the following is NOT true?
Instead of rbind in data frames, we
can also use the $ notation. 24
score: 2
Options Count
Options Count
Options Count
Given the matrix named Grades, which of the following code scripts does NOT generate Grades matrix?
Options Count
Given the matrix named Grades, which of the following code scripts
does NOT generate Grades matrix?
Grades <- c(50,100,45) + c(90,100,70)+
c(75,85,60) 63
score: 2
Grades <-
matrix(c(50,90,75,100,100,85,45,70,60),3,3) 0
score: 0
rbind(c(50,100,45), c(90,100,70),
98.4% c(75,85,60)) 1
score: 0
matrix(c(50,90,75,100,100,85,45,70,60),3)
0
score: 0
Grades <- c(50,100,45) + c(9… rbind(c(50,100,45), c(90,100,…
Options Count
Given the matrix named Cars, which of the following code scripts returns the 2nd Hand price of HONDA ?
Options Count
Given the matrix named Cars, which of the following code scripts
returns the 2nd Hand price of HONDA ?
Cars["HONDA", "2nd Hand"]
42
score: 2
26.6% Cars[2,3]
4
score: 0
65.6%
Cars [3[2]]
1
score: 0
Cars [c(3,2)]
17
score: 0
Given the matrix named Employees, what will be the output when "sort(order(Employee[,3]))" is executed ?
Options Count
Given the matrix named Employees, what will be the output when "
sort(order(Employee[,3]))" is executed ?
1234
24
score: 2
2413
37.5% 37.5% 15
score: 0
Considering the same Employee matrix, let's say the headmaster decided to increase all salaries by 20 percent.
Which of the following code scripts update the Employee matrix correctly according to this new decision?
Options Count
Employee <-
Considering the same Employee matrix, let's say the headmaster cbind(Employee[,1:2],Employee[,3]*1.2) 35
decided to increase all salaries by 20 percent. Which of the score: 2
following code scripts update the Employee matrix correctly
according to this new decision?
Employee <- Employee+Employee*20/100 0
score: 0
Employee <-
43.8% cbind(Employee[c(1,2),],Employee[3,]*1.2) 1
score: 0
54.7%
Employee <-
apply(Employee,Employee[,3]*1.2) 28
score: 0
Options Count
Which of the following code scripts can be used in order to add this new person in the Employee matrix?
Considering the same Employee matrix without any updates, assume the company hired a new person with the following informations : Name : Harun EmployeeID : 20111912
Age : 22 Salary : 3600
Options Count
Which of the following code scripts can be used in order to add this
new person in the Employee matrix?
Employee <-
rbind(Employee,"Harun" =
58
c(20111912,22,3600))
score: 2
Employee <-Employee +
c("Harun",20111912,22,3600) 0
score: 0
90.6% Employee<-rbind("Harun" =
c(20111912,22,3600)) 4
score: 0
Employee<-Employee +
Employee <- rbi… Employee<-rbin… Employee<-Em… rbind("Harun" =
2
c(20111912,22,3600))
score: 0
Options Count
Which of the following codes can NOT be used if you want to add a fourth column of BMI?
Suppose you construct the following data frame: person <- data.frame(name = c("Guliz","Cansu","Sevil"), weight = c(80,65,68), height = c(1.8,1.7,1.65))
Options Count
frame2:
You assume that there cannot be two or more people of the same name and team. You want to have a new data frame with the people that are present only in both of the data
frames. You want to store all information related to a single person in a row.
Options Count
Which of the operations should be enough to realize your aim?
Merge the two data frames by name
and team. 23
score: 2
Options Count
After making sure that the text Ple is located in your working directory, which of the following codes should you run?
Your friend sends you a set of data as a text file (named abc.txt) for a project you two are working on. Here is how the set of data begins: Model-Set-Solution Linear-Convex-Yes
Nonlinear-Convex-No Integer-Not Convex-No ..... You would normally create a new data frame with this information by typing yourself. However, you see that the list goes on
and on and you do not have enough time.
Options Count
read.table("abc.txt", header = T,
sep = "-") 54
score: 2
Options Count
Options Count
What does the following code do?
Creates a data frame named t1.
Adds a fourth column which gives
the BMI category for each person.
Creates another data frame with the 13
20.3% initial information in increasing age
order.
score: 2
9.4%
Options Count
What is X?
We should be careful about the arguments of the binding functions "rbind" and "cbind" when we try to apply them to an X, because their arguments may not always be of the same
data structure.
Options Count
Data frame
21
score: 2
High-dimensional array
16
score: 0
Matrix 21
score: 0
What is X?
25%
Which one of the commands below should be run to access the population component of the list?
Data
The following command is frameankara <-
executed: High-dimensional array, population
list ( name = 'Ankara' Matrix 1/2 = TRUE )
=5270575 , capital
Options Count
Which one of the commands below should be run to access the
population component of the list?
ankara[['population']]
44
score: 2
18.8%
ankara$(population)
2
score: 0
9.4%
68.8% ankara[population]
6
score: 0
ankara$2
12
score: 0
Which one of the commands below should have been executed in order to get such an output?
The following command is executed and the output below is observed: > ankara [[1]] [1] “Ankara” [[2]] [1] 5270575 [[3]] [1] 25 1430 [[4]] [1] TRUE [[5]] [1] “Cankaya”
“Besevler”
Options Count
Which one of the commands below should have been executed in
order to get such an output?
ankara <- list("Ankara", 5270575,
c(25, 1430), FALSE,
51
c("Cankaya","Besevler"))
score: 2
14.1%
ankara <- list("Ankara", 5270575,
25, 1430, FALSE, "Cankaya",
1
"Besevler")
score: 0
79.7%
Options Count
Options Count
Which one of the commands below should have been executed in order to get such an output?
The following command is executed: A <- list(c(7, 13, 17, 10, 3), c(9, 5, 8, 1, 6), c(14, 4, 20, 15, 16), c(2, 18, 11, 12, 19)) After another command is executed, such an output is
given by R: [[1]] [1] 10 [[2]] [1] 5.8 [[3]] [1] 13.8 [[4]] [1] 12.4
Options Count
Which one of the commands below should have been executed in
order to get such an output?
lapply(A, mean)
58
score: 2
sapply(A, mean)
5
score: 0
mean(A)
1
90.6% score: 0
lmean(A)
0
score: 0
Which one of the commands below should have been executed in order to get such an output?
The following command is executed: A <- list(c(7, 13, 17, 10, 3), c(9, 5, 8, 1, 6), c(14, 4, 20, 15, 16), c(2, 18, 11, 12, 19)) After another command is executed, such an output is
given by R: [1] 10.0 5.8 13.8 12.4
Options Count
Which one of the commands below should have been executed in
order to get such an output?
sapply(A, mean)
54
score: 2
10.9%
lapply(A, mean)
3
score: 0
mean(A)
7
84.4% score: 0
smean(A)
0
score: 0
Which one of the followings contains all the elements of the resulting data structure?
The following commands are executed: B <- list(c("a","b","c"),c(1,2,3)) B <- list(B,c("d","e","f"),c("g","h","i")) B[[2]]<-NULL B[[3]]<-c("j","k")
12.5%
25% {a,b,c,d,e,f,g,h,i,j,k}
39
score: 0
{j,k}
1
score: 0
60.9%
{a,b,c,j,k,1,2,3}
16
score: 0