| To: | "Michael Slattery" <Michael.Slattery@epa.state.oh.us> |
|---|---|
| Subject: | Re: first instance extraction |
| From: | David L Lorenz <lorenz@usgs.gov> |
| Date: | Wed, 25 Oct 2006 07:31:20 -0500 |
| Cc: | s-news@wubios.wustl.edu, s-news-owner@lists.biostat.wustl.edu |
| In-reply-to: | <453F0CA9.C718.0085.0@epa.state.oh.us> |
|
Michael, Check the documentation for the duplicated() function. It will return a vector indicating which entries are repeats of a previous entry, therefore !duplicated() returns a vector of the first instance of a value. Dave
Hello all, I am trying to understand how to extract the first instance of a dataframe record, in which the index may appear any number of times (at least once), into a dataframe which then contains the _first_ record of each index (and subsequent data). The dataframe has mixed data types, and the index for extraction can either be a factor or a character, i.e., index data1 data2 data3 char1 ... .... ... char1 char1 char2 char2 char3 char3 char3 char3 char3 char4 On S-Plus 7.0 Pro, Windows XP Pro thanks all !! Michael W. Slattery Geologist, Ohio EPA 122 S. Front Street Lazarus Government Center Columbus OH 43215 michael.slattery@epa.state.oh.us 614-728-1221 (Ph) 614-644-2909 (Fax) |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | first instance extraction, Michael Slattery |
|---|---|
| Next by Date: | Réf. : Convert variable to dummies, gerald . jean |
| Previous by Thread: | first instance extraction, Michael Slattery |
| Next by Thread: | Réf. : Convert variable to dummies, gerald . jean |
| Indexes: | [Date] [Thread] [Top] [All Lists] |