why the object is vector?

前端 未结 3 835
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-21 17:56
> x=c(1,2,3,4,5)  
> x1=list(n1=1,n2=2,n3=x)  
> is.vector(x1)  

[1] TRUE

> is.list(x1)  

[1] TRUE

3条回答
  •  囚心锁ツ
    2020-12-21 18:40

    > is.atomic(x1)
    [1] FALSE
    

    From the R language definition, lists are generic vectors, but not atomic vectors.

提交回复
热议问题