[R] Conversion problem with write.csv and as.character()
peter.neumaier at gmail.com
Thu Mar 10 12:14:29 CET 2016
Hi all, sorry for double/cross posting, I have sent an initial, similar
accidentally to r-sig-finance.
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:
My CSV file contains a sequence of integers (from 1 to x) instead of the
I tried to convert, but ran into "Error in dimnames":
Error in dimnames(cd) <- list(as.character(index(x)), colnames(x)) :
'dimnames' applied to non-array
Called from: as.matrix.xts(x)
a) How can I prevent the conversion into integers to happen when writing
b) if a) is not do-able: how can I convert the date in double format to
chars (i.e. with as.character) ?
Thanks in advance,
[[alternative HTML version deleted]]
More information about the R-help