Grade11 Datascience
Grade11 Datascience
Grade11 Datascience
3 MARK QUESTIONS
1. Define data governance frame work and explain the benefits of using it in an organization.
2. Explain in detail how data has evolved.
UNIT 5- R PROGRAMMING
1 MARK QUESTIONS
1. Choose the homogeneous data structure
a) Vector
b) Array
c) Lists
d) None of the above
2. Choose the correct hierarchy
a) Expression > list > complex >character > double > integer > logical
b) Expression > list > character > complex > double > integer > logical
c) Expression > list > character > complex > logical >double > integer
d) Expression > list > logical >character > complex > double > integer
3. Consider the array ‘A’, created as given below
R_names <- c("R1", "R2".”R3”)
C_names <- c("C1", "C2", "C3")
M_names <- c("M1", "M2")
A = array(5:25, dim = c(3, 3, 2), dimnames = list(R_names, C_names, M_names))
Choose the correct code to access element 21.
a) print(A['R2',"C3","M1"])
b) print(A['R2',"C3","M2"])
c) print(A['R3',"C2","M2"])
d) print(A['R3',"C3","M2"])
2 MARK QUESTIONS
1. Create a multi-element vector that displays every 3rd element between 10 and 35. Write the
statement to find the length of the vector.
2. Rewrite the given code by removing errors.
Amount = as.Integer ( readline (prompt="enter a number"))
Interest = as.Integer ( readline (prompt="enter 2nd number"))
Gross_amount= Amount+Amount * interest/100
Print (Gross_amount)
3. Write a program to create an array including every 5th value between 5 and 60.
i) Add (70,80,90) to the array.
ii) Insert 75 between 70 and 80.
3 MARK QUESTIONS
1. Consider the given table data.
ID Item cost
101 Apple 15
102 Orange 12
102 Grapes 10
a) Create a list with 3 elements based on the columns in the given table.
b) Write the statement to set the names for the elements of the list as (ID, Item, cost).
c) Add the statement to print the cost of the item ‘Apple’.
5-MARK QUESTIONS
1.
a) Find the output of the following code. 2 Marks
fd <- data.frame(
emp_id = c(1:4),
emp_name = c("ali","sameer","vipin","sooraj"),
stringsAsFactors = FALSE
)
Names <- data.frame(fd$emp_name)
id<-data.frame(fd$emp_id)
print(Names)
print(id)
b) Consider the following structure 3 Marks
StudentId Maths Science
1 90 90
2 99 98
3 78 78
4 86 68
5 77 97
i. Write a program to create a data frame ‘DF’ with the given structure.
ii. Write the statements to add a new column ‘Total’ showing the sum of math and science
marks.
iii. What will be the output after performing the following operation on DF
newDF = cbind(DF, Grade=c(“C”,”A”,”A”,”B”))
print(newDF)