Re: [R] IMPORTANT - To remove the null elements from a vector

2010-03-09 Thread Matthew Dowle
Welcome to R Barbara. Its quite an incredible community from all walks of life. Your beginner questions are answered in the manual. See Introduction to R. Please read the posting guide again because it contains lots of good advice for you. Some people read it three times before posting because

Re: [R] IMPORTANT - To remove the null elements from a vector

2010-03-09 Thread Paul Hiemstra
barbara.r...@uniroma1.it wrote: I have a vector that have null elements. How to remove these elements? For example: x=[10 0 30 40 0 0] I want the vector y=[10 30 40] Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

Re: [R] IMPORTANT - To remove the null elements from a vector

2010-03-09 Thread Mario Valle
x <- x[x != 0] If for null elements you intend the value of zero. Ciao! mario On 09-Mar-10 13:48, barbara.r...@uniroma1.it wrote: I have a vector that have null elements. How to remove these elements? For example: x=[10 0 30 40 0 0] I want the vector y=[10 30 40] Thanks

Re: [R] IMPORTANT - To remove the null elements from a vector

2010-03-09 Thread Jorge Ivan Velez
Hi Barbara, Try x[ x != 0 ] HTH, Jorge On Tue, Mar 9, 2010 at 7:48 AM, <> wrote: > > I have a vector that have null elements. How to remove these elements? > For example: > x=[10 0 30 40 0 0] I want the vector y=[10 30 40] > Thanks >[[alternative HTML version deleted]] > > ___

[R] IMPORTANT - To remove the null elements from a vector

2010-03-09 Thread Barbara . Rogo
I have a vector that have null elements. How to remove these elements? For example: x=[10 0 30 40 0 0] I want the vector y=[10 30 40] Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l