s-news
[Top] [All Lists]

copying column names between data frames

To: "S-PLUS Newsgroup (E-mail)" <s-news@lists.biostat.wustl.edu>
Subject: copying column names between data frames
From: "Winifred Lambert" <winnie@ccb.ensco.com>
Date: Mon, 27 Nov 2000 14:17:51 -0500
S-PLUS 2000 Windows 2000

I have a question that I'm sure is obvious to you all who are experts.
I would like to copy specific columns (not all) from one data frame into
another, data and column names altogether.  The problem is in copying
the column names.  I am able to copy all the column names from one data
frame to another using names(), but  names() and name.cols() have not
been able to copy only specific column names for me, particularly if I
just want to copy one column name or if I want to copy columns that are
not sequential.  There must be a function or command or combination of
commands that will copy the column names along with the data of columns
that I specify.

For example, I have a logical vector named 'good' that specifies which
columns in a data frame meet certain specifications.  I want to copy
those columns with their names and data into another data frame that may
already have data in it, or not.  Any ideas?

******************************************************
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 on the Web:
http://technology.ksc.nasa.gov/WWWaccess/AMU/home.html
******************************************************


<Prev in Thread] Current Thread [Next in Thread>
  • copying column names between data frames, Winifred Lambert <=