s-news
[Top] [All Lists]

object table format

To: "S-PLUS Newsgroup (E-mail)" <s-news@lists.biostat.wustl.edu>
Subject: object table format
From: Winifred Lambert <lambert.winifred@ensco.com>
Date: Tue, 27 Nov 2001 10:12:53 -0500
All,

This should be a simple one.  I know I've done this before but for the
life of me can't remember how to do it and can't find any examples in
the email - although I know I've seen some recently and probably deleted
them because I didn't want my mailbox cluttered with emails explaining
something I already knew how to do!

I used table() on a large dataframe containing wind directions by time
of day over a very long time period to determine the number of
occurrences (NUM) of specific wind directions (DIR) during the hours of
the day (HOUR).  It produces a nice table/matrix with the hours as the
column names and the directions as the row names, but I need to have it
in a different format in order to make contour plots and do other
manipulations.  What I need is a dataframe or matrix in the format

DIR     HOUR    NUM
0       0       6
0       1       7
0       2       3
0       3       10
.       .       .
.       .       .
0       23      8
1       0       2
1       1       19
1       2       14
1       3       3
.       .       .

and so on.  The length of unique values for DIR is 361 (0-360) and the
length of unique values for Hour is 24 (0-23).  Sorry for such a simple
question - I must be having a brain-blip.


*************************************************
Winifred C. Lambert            Senior Scientist/Meteorologist
ENSCO, Inc.
Aerospace Sciences and Engineering Division
1980 N Atlantic Ave, Suite 230
Cocoa Beach, FL  32931
VOICE:  321.853.8130           FAX:  321.853.8415
lambert.winifred@ensco.com

AMU Quarterly Reports are available online:
http://science.ksc.nasa.gov/amu/home.html
*************************************************
 

<Prev in Thread] Current Thread [Next in Thread>