Skip to content
Prev 168082 / 398503 Next

Environment change?

Those are not screen output from objects of the same type. The first  
one is being displayed as a character type and the second series of  
values appears to be a numeric vector. You called it a "lsit". In R a  
list is a specific data structure and neither of these appear to be  
displayed in a manner that would suggest a list.

 > one <- c("1", "2", "3")
 > one
[1] "1" "2" "3"

 > num_one <- c( 1,2,3)
 > num_one
[1] 1 2 3

 > list_one <- list(1,2,3)
 > list_one
[[1]]
[1] 1

[[2]]
[1] 2

[[3]]
[1] 3

 > list_two <-list(c(1,2,3))
 > list_two
[[1]]
[1] 1 2 3

You should be using str(), typeof(), and class() functions to answer  
these questions. The screen display may not always be sufficient to  
determine important features.