[R-SIG-Finance] write.csv conversion problem

Roger J. Bos roger.bos at gmail.com
Thu Mar 10 11:50:04 CET 2016


Peter,

Dates are always stored as integers, so that is expected. You would need to use as.character() to convert the date before you output it to the file, but then it won't be of type double. 

Also, thee is a general r-help list where these types of questions should go. 

Thanks,,

Roger

On March 10, 2016, at 5:44 AM, Peter Neumaier <peter.neumaier at gmail.com> wrote:

Hi all,

I am writing a matrix (typeof = double) into a CSV file with write.csv.

My first column of the matrix is a date in the form yyyy-mm-dd hh:mm:ss:

> a_fetchdata[1,0]

2016-02-09 07:30:00
> typeof(a_fetchdata[1,0])
[1] "double"


My CSV file contains a sequence of integers (from 1 to x) instead of the
expected date.

How can I prevent that conversion to happen when writing into CSV?

Thanks
Peter

	[[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.


More information about the R-SIG-Finance mailing list