as.vector(na.omit(inc[,5])
?na.omit
Paolo
Hi,
I've a vector like this:
--
> inc[,5]
[1]NANANANANANANA
[8]NANANANANANANA
?is.na and its negative !is.na
Try something like this
xx <- c(NA, NA, 1, 2, 3)
bb <- xx[!is.na(xx)]
bb
--- On Tue, 6/23/09, Alfredo Alessandrini wrote:
> From: Alfredo Alessandrini
> Subject: [R] vector and NA
> To: r-help@r-project.org
> Received: Tuesday, June 23,
alfreale wrote:
>
>
> I've a vector like this:
>
>> inc[,5]
>
> How can I extract a vector without the NA value?
>
>
inc[,5][!is.na(inc[,5])]
--
View this message in context:
http://www.nabble.com/vector-and-NA-tp24162879p24163839.html
Sent from the R help mailing list archive at Nabbl
On 6/23/2009 5:41 AM, Alfredo Alessandrini wrote:
> Hi,
>
> I've a vector like this:
>
> --
>> inc[,5]
> [1]NANANANANANANA
> [8]NANANANANA
Hi,
I've a vector like this:
--
> inc[,5]
[1]NANANANANANANA
[8]NANANANANANANA
[15]NANANANA
5 matches
Mail list logo