0
> a=c(1,2,3,4)  
> a      
[1] 1 2 3 4  
> typeof(a)  
[1] "double"  
> mode(a)  
[1] "numeric"  
> attributes(a)  
NULL 
> str(a)  
num [1:4] 1 2 3 4  

is there something to make a display it vector?

4

1 回答 1

1

Maybe is.vector()? This tests whether an object is a vector:

is.vector(a)
[1] TRUE

As a counter-example:

g <- function(x)x

is.vector(g)
[1] FALSE

class(g)
[1] "function"
于 2012-07-19T12:45:08.303 回答