s-news
[Top] [All Lists]

mixed success- how to remove rows with missing factor value in it?

To: <s-news@lists.biostat.wustl.edu>
Subject: mixed success- how to remove rows with missing factor value in it?
From: "Danni Wang" <wangdn@uclink4.berkeley.edu>
Date: Sat, 26 Oct 2002 12:43:07 -0700
Importance: Normal
In-reply-to: <200209091728.NAA01240@nightingale.hcp.med.harvard.edu>
Reply-to: <wangdn@uclink4.berkeley.edu>
- This works 

When you say they are missing, are they really 'blank'?  I would assume
that if they are characters, then missing values are blank, so the
following should work;

data[-which(data$timestamp==" "),]

- There are also circumstances that missing strings are NA, such as

> data
V1      V2      timestamp
1       2       a
3       4       NA
NA      7       NA
45      NA      c
9       6       d

data[-which(data$timestamp=="NA"),] doesn't work.

Regard,

<Prev in Thread] Current Thread [Next in Thread>
  • mixed success- how to remove rows with missing factor value in it?, Danni Wang <=