[R] Finding the name "vector"

Joshua Wiley jwiley.psych at gmail.com
Tue Mar 15 06:17:19 CET 2011


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 <smithlaura937 at gmail.com> 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] "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 numeric,
> logical, or integer, please?
>
> Thank you.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list