[R] Date in dataframe manipulation

Don MacQueen macq at llnl.gov
Fri Mar 24 22:19:27 CET 2006


Try

    FireDataAppling[,c('STARTDATE','County','TOTAL','CAUSE')]

or perhaps the subset() function.

The way you are doing it is more complex than necessary (internally 
complex, I mean, not how the code looks).

-Don

At 3:29 PM -0500 3/24/06, Dan Chan wrote:
>Hi,
>
>I have a dataframe with many columns, including date and I want to keep
>only a few of the columns including date column.
>
>I used the following command:
>with(FireDataAppling, cbind(STARTDATE, County, TOTAL, CAUSE)
>
>It works, but the date becomes days from Jan 1, 2001. 
>
>FireDataAppling$STARTDATE[1] gives
>[1] 2001-01-04 00:00:00 
>1703 Levels: .........
>
>After the cbind command, the entry becomes a 4. 
>
>I want to get 2001-01-04.  What command should I use? 
>
>Thank you.
>
>Daniel Chan
>Meteorologist
>Georgia Forestry Commission
>P O Box 819
>Macon, GA
>31202
>Tel: 478-751-3508
>Fax: 478-751-3465
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA




More information about the R-help mailing list