0
0
R Programmingprogramming~20 mins

Numeric type in R Programming - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Numeric Type Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of numeric division and type check
What is the output of this R code snippet?
R Programming
x <- 5 / 2
typeof(x)
A"double"
B"integer"
C"numeric"
D"complex"
Attempts:
2 left
💡 Hint
In R, division usually results in a floating-point number.
Predict Output
intermediate
2:00remaining
Output of integer coercion with as.integer()
What is the output of this R code?
R Programming
y <- as.integer(3.7)
y
A3
B3.7
C4
DNA
Attempts:
2 left
💡 Hint
as.integer() truncates the decimal part.
🔧 Debug
advanced
2:00remaining
Type coercion in numeric vector creation
What is the output of this R code?
R Programming
z <- c(1, 2, "3", 4)
typeof(z)
A"numeric"
B"character"
CError: non-numeric argument to binary operator
D"integer"
Attempts:
2 left
💡 Hint
Mixing numbers and strings in a vector causes coercion.
Predict Output
advanced
2:00remaining
Result of numeric overflow in R
What is the output of this R code?
R Programming
big_num <- 1e308 * 10
big_num
A1e309
BNaN
C0
DInf
Attempts:
2 left
💡 Hint
Multiplying very large numbers can exceed the maximum representable value.
🧠 Conceptual
expert
2:00remaining
Understanding numeric precision in R
Which statement best describes numeric precision in R for double type numbers?
ADouble precision numbers in R are stored as integers internally.
BDouble precision numbers in R can represent all decimal numbers exactly.
CDouble precision numbers in R have about 15-16 decimal digits of precision.
DDouble precision numbers in R have unlimited precision.
Attempts:
2 left
💡 Hint
Think about how computers store floating-point numbers.