R Coding Challenges
Practice R step by step. Code, run tests, and ask the AI Tutor for hints.
Reverse a Vector
Write an R function solution(x) that returns the vector x in reverse order. Example solution(c(1, ...
Sort Vector Ascending
Write an R function solution(x) that returns the elements of x sorted in ascending order. Example ...
Unique Elements
Write an R function solution(x) that returns the unique elements of x, keeping their first-appearanc...
Cumulative Sum
Write an R function solution(x) that returns the cumulative sum of the numeric vector x. Example s...
Range (Max Minus Min)
Write an R function solution(x) that returns the range (maximum minus minimum) of the numeric vector...