Skip to content
Prev 276111 / 398506 Next

NROW doesn't equal length(x)

Your first problem is that you aren't using paste() properly: print
out paste(ct3[, 1:2]) and take a look at it.

This works:

apply(head(ct3[,1:2]),1,paste,collapse = " ")

You also have the format argument to POSIXct wrong. See ?strptime for details.

So the whole line (if you want to do it in one) would be something like this:

v = xts(ct3[,3], as.POSIXct(apply(ct3[, 1:2],1, paste, collapse = "
"), format = "%m/%d/%Y %H:%M:%S"))

head(v)

2011-02-22 09:31:13 19.46
2011-02-22 09:31:28 19.50
2011-02-22 09:31:43 19.55
2011-02-22 09:31:58 19.59
2011-02-22 09:32:13 19.67
2011-02-22 09:32:28 19.68

Michael

PS -- It's best practice to cc the list as well as me in replies so
that this gets archived.
On Tue, Nov 1, 2011 at 5:37 PM, Muhammad Abuizzah <izzah100 at yahoo.com> wrote: