Entering edit mode
Peng Yu
▴
940
@peng-yu-3586
Last seen 10.3 years ago
Hi,
Please see the code below this message. 'a' is a vector, 'b' is a
scalar. But their types are show the same ('numeric'). If I use
'class()', I will not be able to tell the type difference between a
vector and a scalar. I am wondering if there is any other command that
can tell the type difference between a vector and a scalar.
Regards,
Peng
> a=c(1,2,3)
> class(a)
[1] "numeric"
> b=2
> class(b)
[1] "numeric"