You are on page 1of 14

 Which one creates a different output?

Graphical Representation Data

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

seq(5,by=1,length.o… seq(6,10,by=1) seq(to=10,from=6)


Options Count

Graphical Representation Data

 Which one is the output of c(-2,6,3) + c(1,3,0,-1)

Graphical Representation Data

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

Graphical Representation Data

 Which one creates the sequence -2 -2 -1 0 0 1 2 2 ?

Graphical Representation Data

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?

Real GDP Nominal GDP


rep(-2:2,c(2,1,2,… seq(-2:2,c(2,1,2,… rep(-2:2,c(-2,-1,…
Japan 492 495

Egypt 27 32

France 280 291

Brazil 224 251

Graphical Representation Data

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

Real.GDP <- list(492,27,280,224)


87.5% Nominal.GDP <- 6
list(495,32,291,251)
score: 0

Real.GDP <- c[492,27,280,224]


Real.GDP Nominal.G… Real.GDP Nominal.G… 1/2 Nominal.GDP <- c[495,32,291,251] 1
score: 0

Options Count

Graphical Representation Data

 Which one gives names (Japan, Egypt, France, Brazil) to the vectors Real.GDP and Nominal.GDP?

Graphical Representation Data

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%

Graphical Representation Data

 Which of the following sorts Real.GDP according to the Nominal.GDP?


names(Real.GDP) names(Nominal.GDP) <- c("Japan","Egypt","Fra…

Graphical Representation Data

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

Real.GDP[order… Nominal.GDP(or… Real.GDP(sort[…


Options Count

Graphical Representation Data

 According to this dePnition, which of the following gives the GDP deQator vector of countries Japan, Egypt, France
and Brazil?

GDP deflator is calculated as "(Nominal GDP / Real GDP) x 100".

Graphical Representation Data

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

GDP.Deflator <- (Nominal.GDP /


Real.GDP)x100 1
score: 0

GDP.Deflator <- Real.GDP /


95.3% Nominal.GDP*100 0
score: 0

GDP.Deflator <- Nominal.GDP /


Real.GDPx100 2
GDP.Deflator <-… GDP.Deflator <-… GDP.Deflator <-… score: 0

Options Count

Graphical Representation Data


 Which of the following includes numbers which have exactly 2 decimal places for the GDP.DeQator?

Graphical Representation Data

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

round(GDP.Deflator,2) signif(GDP.Deflator,2) 1/2


Options Count

Graphical Representation Data

 Which of the following creates GDP deQator groups "Low inQation" and "High inQation"?

Graphical Representation Data

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

Graphical Representation Data

 Which one gives the names of the countries whose GDP deQator is less than 110?

Graphical Representation Data

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

Graphical Representation Data

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.

names(GDP.Deflator[… names(GDP.Deflator[… 1/2


Graphical Representation Data

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

ii,iii i,ii i,ii,iii ii


Options Count

Graphical Representation Data

 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.

Graphical Representation Data

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

Graphical Representation Data


 Which code do we need to use?

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.

Graphical Representation Data

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

lapply(Grades,sd) sapply(Grades,sd) lapply(Grades,var)


Options Count

Graphical Representation Data

 Which of the following is NOT true?

Graphical Representation Data

Options Count
Which of the following is NOT true?
Instead of rbind in data frames, we
can also use the $ notation. 24
score: 2

ifelse is used for data filtering in


37.5% data frames as well. 2
score: 0
54.7%

[-2,] deletes the second row in the


data frame. 3
score: 0

[[1]] and [,1] basically returns the


same thing. 35
Instead of rbind in dat… ifelse is used for data f… 1/2 score: 0

Options Count

Graphical Representation Data

 What does this code perform?

We have the following code: >student<-data.frame(ID=student.ID,dept=student.dept,GPA=student.GPA) >student<-rbind(student,Cem=list(12,"EC",3.25))


>student[student$GPA<=3.5,]

Graphical Representation Data

Options Count

A data frame called student is


formed. A new component of the
data frame, Cem, is added as a row.
All the rows that correspond to the 46
students whose GPAs are less than
or equal to 3.5 are obtained.
What does this code perform? score: 2

A data frame called student is


formed. A new component of the
data frame, Cem, is added as a
26.6%
column. Only the columns that
1
correspond to the students whose
GPAs are less than or equal to 3.5
are obtained.
71.9% score: 0

A data frame called student is


formed. A new component of the
data frame, Cem, is added as a
column. All the rows that
0
A data frame cal… A data frame cal… A data frame cal… correspond to the students whose
GPAs are less than or equal to 3.5
are obtained.
score: 0

A data frame called student is


formed. A new component of the
data frame, Cem, is added as a row.
Only the GPA column that
17
corresponds to the students whose
GPAs are less than or equal to 3.5 is
obtained.
score: 0

Options Count

Graphical Representation Data

 Given the matrix named Grades, which of the following code scripts does NOT generate Grades matrix?

Grades matrix is defined as follows:


50 100 45
90 100 70
75 85 60

Graphical Representation Data

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

Graphical Representation Data

 Given the matrix named Cars, which of the following code scripts returns the 2nd Hand price of HONDA ?

Cars matrix is defined as follows:


Original Second Hand
BMW 75000 16000
FIAT 32000 50000
HONDA 40000 25000

Graphical Representation Data

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

Cars["HONDA", "2nd… Cars[2,3] Cars [3[2]] 1/2


Options Count

Graphical Representation Data

 Given the matrix named Employees, what will be the output when "sort(order(Employee[,3]))" is executed ?

EmployeeID Age Salary


Funda 20110012 34 7500
Ege 20110024 25 3000
Kaya 20110000 55 11500
Cenk 20111212 23 3800

Graphical Representation Data

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

1500 7500 3800 3000


1
score: 0
23.4%

3000 3800 7500 11500


24
score: 0

1234 2413 1500 7500 3800 3000 1/2


Options Count

Graphical Representation Data

 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?

Graphical Representation Data

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

Employee <- cbi…


Graphical Representation Employee <- cbi… Employee <- ap… Data

 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

Graphical Representation Data

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

Graphical Representation Data

 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))

Graphical Representation Data

Options Count

person[4,] <- person[2,] /


person[3,]^2 61
score: 2

person[[4]] <- person[[2]] /


person[[3]]^2 2
score: 0

person$bmi <- person$weight /


person$height^2 1
score: 0

person[,4] <- person[,2] /


person[,3]^2 0
Which of the following codes can NOT be used if you want to add a score: 0
fourth column of BMI?
Options Count

Graphical Representation Data

 Which of the operations should be enough to realize your aim?


95.3%
You have the following data frames: frame1:

Name Team City


1 Su FB Bursa
2 Berk FB person[4,]
Izmir <- per… person[[4]] <- pe… person$bmi <- p…
3 Cem GS Ankara
4 Tan FB Ankara
5 Su BJK Bursa
6 Naz GS Adana

frame2:

Name Team Age


1 Su FB 16
2 Naz GS 28
3 Can BJK 20
4 Tan FB 21

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.

Graphical Representation Data

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

Assign a set of ID's to each data


35.9% frame, then merge by ID. 36
score: 0

56.3% Bind the two data frames together


by cbind. 0
score: 0

Merge the two data frames by name


only. 5
Merge the two d… Assign a set of I… Merge the two d… score: 0

Options Count

Graphical Representation Data

 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.

Graphical Representation Data

Options Count

read.table("abc.txt", header = T,
sep = "-") 54
score: 2

read(abc.txt, header=F, sep = "")


1
score: 0
table("abc.txt", sep = ",")
1
After making sure that the text file is located in your working score: 0
directory, which of the following codes should you run?
read.table(header = T, abc.txt, sep =
"-") 8
score: 0
12.5%

Options Count

Graphical Representation Data


84.4%

 What does the following code do?


read.table("abc.txt", he… read(abc.txt, header=… 1/2
t1 <- data.frame(Name = c("Mert","Ahmet","Deniz"), BMI = c(17,26,23), Age = c(21,24,30)) t2 <- t1[order(t1$Age),] t1$Category <- ifelse(t1$BMI<18.5, "Underweight" ,
(ifelse(t1$BMI>25, "Overweight", "Normal Range")))

Graphical Representation Data

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%

68.8% Creates a data frame named t1.


Rearranges the places of rows in
increasing age order. Does not
change the data frame's structure 6
further, but outputs the categories
for each person.
score: 0
Creates a data frame… Creates a data frame… 1/2
Creates a data frame named t1.
Rearranges the places of rows in
increasing age order. Adds a fourth
44
column which gives the BMI
category for each person.
score: 0

Creates a data frame named t1.


Adds a fourth column which gives
the BMI category for each person.
1
Sorts the final table in increasing
order.
score: 0

Options Count

Graphical Representation Data

 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.

Graphical Representation Data

Options Count

Data frame
21
score: 2

High-dimensional array
16
score: 0
Matrix 21
score: 0
What is X?

None of the above.


6
score: 0
9.4%

32.8% Options Count


32.8%
Graphical Representation Data

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

Graphical Representation Data

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

ankara[['population']] ankara$(population) 1/2


Options Count

Graphical Representation Data

 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”

Graphical Representation Data

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%

ankara <- list(name = "Ankara",


population = 5270575,
district_neighbourhood = c(25,
9
1430), capital = FALSE, district =
c("Cankaya","Besevler"))
ankara <- list("Ankara"… ankara <- list("Ankara"… 1/2
score: 0

ankara <- list(1 = "Ankara", 2 =


5270575, 3 = c(25, 1430), 4 =
FALSE, 5 = 3
c("Cankaya","Besevler"))
score: 0

Options Count
Options Count

Graphical Representation Data

 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

Graphical Representation Data

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

lapply(A, mean) sapply(A, mean) mean(A)


Options Count

Graphical Representation Data

 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

Graphical Representation Data

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

sapply(A, mean) lapply(A, mean) mean(A)


Options Count

Graphical Representation Data

 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")

Graphical Representation Data


Options Count
Which one of the followings contains all the elements of the
resulting data structure?
{a,b,c,g,h,i,j,k,1,2,3}
8
score: 2

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

{a,b,c,g,h,i,j,k,1,2,3} {a,b,c,d,e,f,g,h,i,j,k} {j,k} 1/2 Options Count

Graphical Representation Data

 No feedback type questions selected and/or found in the form.

You might also like