0

I am trying to create a xts object (1 year, hourly data). The problem is, R does not let me use order.by, since there seems to be a random NA value in the vector I want to use to order.

    > x = read.csv(choose.files(), header=TRUE, sep=";")
    > x = as.POSIXct(Data_neu$Date, format="%d.%m.%Y %H:%M")
    > str(x)
     POSIXct[1:8760], format: "2016-01-01 00:00:00" "2016-01-01 01:00:00"
    > which(is.na(x))
    [1] 2067 

To answer one of the questions that might come up - no the value was not NA before formatting. It was just as all the other values whithin the vector. More precisely it looked like this: 27.03.2016 02:00.

Why does exactly this value converts to NA when formating it? I can not find any logical explanation (nor solution).

Thanks in advance! I appreciate any kind of help or comment..

shenflow
  • 345
  • 2
  • 12

0 Answers0