What will be the output of the following R code?
> x <- data.frame(foo = 1:4, bar = c(T, T, F, F))
> ncol(x)
> x <- data.frame(foo = 1:4, bar = c(T, T, F, F))
> ncol(x)
A. 2
B. 4
C. 7
D. 9
Answer: Option A
> x <- data.frame(foo = 1:4, bar = c(T, T, F, F))
> ncol(x)
A. 2
B. 4
C. 7
D. 9
Answer: Option A
What does the function print() do in R?
A. Display the result of a calculation
B. Read input from the user
C. Plot a graph
D. Install a package
What is the purpose of the seq() function in R?
A. Create a sequence of numbers
B. Sort a vector
C. Merge two data frames
D. Compute the mean of a numeric vector
Join The Discussion