On 15/03/11 05:17, Joshua Wiley wrote:
Hi Laura,
?is.vector
Consider methods::is if you might ever use attributes:
x<- 1:10
is.vector(x)
# [1] TRUE
comment(x)<- "Mine!"
is.vector(x)
# [1] FALSE
is(x, "vector")
# [1] TRUE
Allan
__
R-help@r-projec
Hi Laura,
?is.vector
> is.vector(1:10)
[1] TRUE
> is.vector(matrix(1:10))
[1] FALSE
Cheers,
Josh
On Mon, Mar 14, 2011 at 9:58 PM, Laura Smith wrote:
> Hello:
>
> Here are some basic class items:
>
>> x <- 1:10
>> class(x)
> [1] "integer"
>> x.mat <- matrix(1:6,nrow=2)
>> class(x.mat)
> [1] "
Hello:
Here are some basic class items:
> x <- 1:10
> class(x)
[1] "integer"
> x.mat <- matrix(1:6,nrow=2)
> class(x.mat)
[1] "matrix"
> class(x>3)
[1] "logical"
> test <- function() { plot(1:10) }
> class(test)
[1] "function"
>
Is there something that says "vector", please? Or does it go to nu
3 matches
Mail list logo