
Unit - II
Presentation
•
Computers
•
Professional Development
•
Practice Problem
•
Medium
Dr.Adlin BHC
Used 1+ times
FREE Resource
34 Slides • 56 Questions
1
2
Open Ended
Explain the significance of the S language in the development of R.
3
Fill in the Blanks
Type answer...
4
Multiple Choice
What year was S Version 4 released?
1993
1998
2004
2008
5
Multiple Choice
What is R primarily used for?
Statistical computing and graphics
Web development
Game development
Mobile app development
6
Fill in the Blanks
7
8
Open Ended
Describe the significance of the GPL in R's global adoption.
9
10
Multiple Choice
What does the if...else statement provide in R?
An alternative block when the condition is TRUE
An alternative block when the condition is FALSE
A way to repeat code
A method to create functions
11
12
Multiple Choice
What grade will be assigned if the score is 75?
A
B
C
D
13
14
15
Multiple Choice
What does the 'break' statement do in a loop?
It skips the current iteration
It ends the loop
It continues to the next iteration
It restarts the loop
16
17
Multiple Choice
What is the purpose of the return statement in R?
To send a value back to the calling program
To print the result
To exit the program
To define a function
18
19
Multiple Choice
What will be the output of the max_value function when the inputs are 10 and 20?
10
20
Error
None of the above
20
Multiple Choice
What is the output of the function check_even when the input is 7?
Even Number
Odd Number
Error
None of the above
21
Multiple Choice
Assertion (A):- If the arguments in function call statement match the
number and order of arguments as defined in the function definition,
such arguments are called positional arguments.
Reasoning (R):- During a function call, the argument list first contains
default argument(s) followed by positional argument(s).
Both A and R are true and R is the correct explanation for A
Both A and R are true and R is not the correct explanation for A
A is True but R is False
A is false but R is True
22
23
Open Ended
Explain the importance of functions in R programming.
24
Fill in the Blanks
Type answer...
25
Multiple Choice
What is the purpose of using functions in R?
To reduce code repetition
To increase code size
To make code less readable
To avoid debugging
26
Multiple Choice
A function is
a line of code that will evalute to true or false
the same thing as a loop
a set of commands
a piece of code that you can easily call over and over again
27
28
Open Ended
Explain how anonymous functions are used in R with an example.
29
Multiple Choice
What is the output of the function call power(5, 3)?
5
25
125
2
30
Multiple Choice
What is the purpose of default arguments in R functions?
To make functions flexible
To limit the number of arguments
To create anonymous functions
To define global variables
31
32
33
Open Ended
Explain the concept of lexical scoping in R.
34
35
Multiple Choice
What is the search order for variables in R when a variable is referenced?
Inside the function (Local Environment)
In the Parent Environment
Global Environment
Base Package in R
36
37
Open Ended
Explain the difference between local and global variables in R programming.
38
Multiple Choice
What will be the output of the function f() in Example 1?
5
10
15
Error
39
Multiple Choice
In the context of R programming, what does the term 'global environment' refer to?
The environment inside a function
The environment outside of all functions
The environment where local variables are stored
The environment for global variables only
40
41
Multiple Choice
What is the purpose of the Super Assignment Operator (<<-) in R?
To assign a variable in the local environment
To assign a variable in the global environment
To modify a variable in the current function
To create a new variable in the local environment
42
43
Open Ended
What is the difference in days between the two dates defined in the example?
44
Open Ended
What function is used to get the current date in R?
45
Multiple Choice
What is the preferred storage format for date-time objects in R?
POSIXlt
POSIXct
Date
Datetime
46
Multiple Choice
What is the format used to store dates in R?
YYYY-MM-DD
MM-DD-YYYY
DD-MM-YYYY
YYYY/DD/MM
47
48
Open Ended
Explain how to create a date using the `as.Date()` function in R.
49
Multiple Choice
What is the output of the command `format(d, "%d-%m-%Y")` where d is created as `d <- as.Date("2025-01-15")`?
15-01-2025
2025-01-15
01-15-2025
15-2025-01
50
Multiple Choice
What does the format code %d represent in date formatting?
Year
Month
Day
Hour
51
52
Multiple Choice
What is the difference in days between the dates 2025-01-01 and 2025-01-15?
14 days
15 days
16 days
13 days
53
Multiple Choice
What is the result of adding 7 days to the date 2025-01-15?
2025-01-22
2025-01-21
2025-01-20
2025-01-23
54
Multiple Choice
What are the extracted day, month, and year from the date 2025-01-15?
15, 01, 2025
01, 15, 2025
2025, 01, 15
15, 2025, 01
55
56
Multiple Choice
The ________ function can be used to create vectors of objects by
concatenating things together.
class()
concat()
c()
cp()
57
58
Fill in the Blanks
Type answer...
59
Open Ended
List two common string functions in R.
60
Multiple Choice
What is the primary use of a data frame in R?
To store text data
To represent categorical data
To hold tabular data with rows and columns
To create arrays
61
Multiple Choice
Which of the following statement is alternative to ?factors
help(factors)
print(factors)
cat(factors)
scan(factors)
62
63
64
Multiple Choice
What is the purpose of the seq() function in R?
To generate random numbers
To create sequences with control
To perform type coercion
To store Boolean values
65
66
Multiple Choice
What is the output of the function `seq(from = 1, to = 10, by = 2)`?
1 3 5 7 9
2 4 6 8 10
1 2 3 4 5
5 10 15 20 25
67
68
Multiple Choice
Using the command v[c(1, 3)], what elements are returned from the vector v <- c(10, 20, 30, 40)?
10 and 20
20 and 30
10 and 30
30 and 40
69
Multiple Choice
What does the negative index v[-1] do in the context of the vector v <- c(10, 20, 30, 40)?
Removes the first element
Removes the last element
Removes all elements
Keeps all elements
70
Multiple Choice
What is the output of the command v[2] when v is defined as v <- c(10, 20, 30, 40)?
10
20
30
40
71
Multiple Choice
What will be the output of the following R code?
x<-1:10
print(x)
1,10
1,2,3,4,5,6,7,8,9,10
0,1,2,3,4,5,6,7,8,9
1,2,3,4,5,6,7,8,9
72
Multiple Choice
What will be the output of the following R program?
x<-5:10
x[3]
7
6
5
10
73
74
Open Ended
Explain the significance of named indexing in R vectors.
75
Multiple Choice
What does the command v[2:4] return when v is defined as v <- c(10, 20, 30, 40)?
10
20 30 40
20 30
30 40
76
Multiple Choice
What is the output of the command v[4] when v is defined as v <- c(10, 20, 30, 40)?
10
20
30
40
77
78
Multiple Choice
What is the syntax for creating an array in R?
array(data, dim)
array(dim, data)
createArray(data, dim)
array(data)
79
Open Ended
Explain how to filter even numbers from a vector in R using logical conditions.
80
Multiple Choice
What does the condition v > 20 return in the example provided?
TRUE TRUE FALSE
FALSE TRUE TRUE
TRUE FALSE FALSE
FALSE FALSE TRUE
81
Multiple Choice
What is the purpose of logical subscripts in R?
To filter and extract elements of a vector
To create loops
To define arrays
To perform mathematical operations
82
83
84
85
86
87
88
89
90
Poll
How confident do you feel about this topic now?
Show answer
Auto Play
Slide 1 / 90
SLIDE
Similar Resources on Wayground
81 questions
chapter nine security +
Presentation
•
University
87 questions
Sky Science
Presentation
•
KG - University
89 questions
MSD review
Presentation
•
Professional Development
83 questions
DISORDERS OF THE MALE RT
Presentation
•
University
83 questions
Final Review
Presentation
•
University
87 questions
WWI DC
Presentation
•
University
88 questions
MATERI PELATIHAN PEMBELAJARAN BERDIFFERENSIASI
Presentation
•
Professional Development
84 questions
105 Planning and overseeing PPT 1
Presentation
•
KG - University
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade