1. LON-CAPA Logo
  2. Help
  3. Log In
 

Browsing resource, all submissions are temporary.


Basic Classes of Objects in R

Note: You should be able to answer almost all questions by typing the commands in R. It is recommended that you first figure out the answer and then test it by typing the commands in R. Always check your answers by typing the R commands first before submitting them.

a. Suppose I type x <- 10:pi in R. Use the 'class()' function to determine the class of 'x'.





 Tries 0/2

b. What is the class of the object defined by the expression x <- c("abcd", 1:19, TRUE, 2.34:15.67) ?





 Tries 0/2


c. What happens if I type as.numeric(c(1:4,"11a",FALSE,9)) ?





 Tries 0/2

d. What happens if I type as.numeric(c(1:4,11,FALSE,9)) ?





 Tries 0/2