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-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.