Clayton -
From your explanation, it sounds like you want to create a new file removing the "Location" variable, and all the variables that have the string "Ambient" or "Name" in their names. Suppose that your data frame is called mydata, and you wish to create a reduced csv file called "mydata.csv"

write.csv(mydata[,grep('Location|Ambient|Name',names(mydata),invert=TRUE)],
          file='mydata.csv')

should do what you want, but without a more concrete example, it's
just a guess.

                                        - Phil Spector
                                         Statistical Computing Facility
                                         Department of Statistics
                                         UC Berkeley
                                         spec...@stat.berkeley.edu

On Tue, 15 Feb 2011, Clayton Dorrity wrote:

I need help.

I have very big .csv files with many unnecessary columns.  From the original
.csv files I would like to create a new .csv file with just the columns I
need.

For example:

The original column heading are: Date, Time, Location, Sensor Name, Sensor
Serial, Ambient Temp, IR Temp, Sensor Name.1, Sensor Serial.1, Ambient
Temp.1, IR Temp.1, Sensor Name.2, Sensor Serial.2, Ambient
Temp.2,..........Sensor Name.45

I would like to create a new .csv file with only Date, Time, Sensor Serial,
IR Temp, Sensor Serial.1, IR Temp.1, Sensor Serial.2, IR Temp.2,.....Sensor
Serial.45, IR Temp.45, etc


Any help on this matter would be greatly appreciated.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to