[R] write.csv changes the format of the date
David Winsemius
dwinsemius at comcast.net
Mon Nov 1 14:45:06 CET 2010
On Nov 1, 2010, at 9:14 AM, Santosh Srinivas wrote:
> Dear Group,
>
> Why does write.csv modify the date format when it write to a file.
>
> I have the following variable Param_Dat:
>
> dput(Param_Dat)
> structure(list(Last_Successful_Run = structure(1L, .Label =
> "30/10/2010",
> class = "factor")), .Names = "Last_Successful_Run", class =
> "data.frame",
> row.names = c(NA,
> -1L))
>
>
> When I do:
> write.csv(Param_Dat,"Param.csv",quote=F,row.names=F)
>
> The format of the info in the file is:
> Last_Successful_Run
> 31OCT2010
Unable to reproduce. When I execute that code I get this file:
Last_Successful_Run
30/10/2010
I'm guessing you are viewing that file with something other than a
plain text editor.
>
> I want to retain the dd/mm/YYYY format ...
>
> Please advise.
--
David Winsemius, MD
West Hartford, CT
> sessionInfo()
R version 2.11.1 Patched (2010-06-14 r52281)
x86_64-apple-darwin9.8.0
locale:
[1] en_US/en_US/en_US/C/en_US/en_US
attached base packages:
[1] splines stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] Hmisc_3.8-1 survival_2.35-8 dismo_0.5-6 rJava_0.8-7
[5] raster_1.5-16 sp_0.9-72 sos_1.2-9 brew_0.1-1
[9] lattice_0.18-8
loaded via a namespace (and not attached):
[1] cluster_1.12.3 grid_2.11.1 tools_2.11.1
More information about the R-help
mailing list