| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | reversing a scale |
| From: | "Walter R. Paczkowski" <dataanalytics@earthlink.net> |
| Date: | Fri, 18 Aug 2006 13:18:03 -0400 |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=iDQDC4pua+5OsAB8ybCZzD71B/z9uA+X6FdVzBvttZRbmGmQoMS48oIlwEASv0Lg; h=Received:Message-Id:X-Mailer:Date:To:From:Subject:Mime-Version:Content-Type:X-ELNK-Trace:X-Originating-IP; |
|
Hi, I'm looking for a simple way to convert a scale such as 1, 2, 3, 4, 5 to 5, 4, 3, 2, 1. In other words, I want to map 1 --> 5 2 --> 4 3 --> 3 4 --> 2 5 --> 1 So if I have a vector (5, 1, 3, 4, 2, 1, 1, 5), I want to map it to a new vector (1, 5, 3, 2, 4, 5, 5, 1). I've been using ifelse statements which works but if my scale is, say, 1:100, then I have 100 nested statements - that's not good. Any suggestions? Thanks, Walt Paczkowski Walter R. Paczkowski, Ph.D. Data Analytics Corp. 44 Hamilton Lane Plainsboro, NJ 08536 (V) 609-936-8999 (F) 609-936-3733 |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | compare BIG lists, Kamil Toth |
|---|---|
| Next by Date: | Re: reversing a scale, Chuck Cleland |
| Previous by Thread: | DSC 2007, Paul Murrell |
| Next by Thread: | Re: reversing a scale, Chuck Cleland |
| Indexes: | [Date] [Thread] [Top] [All Lists] |