I\'m still relatively new to R and hope you can again help me. I have a character vector with a length of 42000. The vector looks like this:
a <- c(\"blab
maybe with
library(reshape2)
colsplit(a, "\\-", names=c("A", "B", "C"))
A B C
1 blablabla 19960101T000000Z 1.tsv
2 blablabla 19960101T000000Z 2.tsv
3 blablabla 19960101T000000Z 3.tsv
or
b <- colsplit(a, "[[:punct:]]|\\T|\\.", names=c("A", "B", "C", "D","E"))
A B C D E
1 blablabla 19960101 000000Z 1 tsv
2 blablabla 19960101 000000Z 2 tsv
3 blablabla 19960101 000000Z 3 tsv
and then
library(lubridate)
b$B <- ymd(b$B)
A B C D E
1 blablabla 1996-01-01 000000Z 1 tsv
2 blablabla 1996-01-01 000000Z 2 tsv
3 blablabla 1996-01-01 000000Z 3 tsv
str(b)
'data.frame': 3 obs. of 5 variables:
$ A: chr "blablabla" "blablabla" "blablabla"
$ B: POSIXct, format: "1996-01-01" "1996-01-01" "1996-01-01"
$ C: chr "000000Z" "000000Z" "000000Z"
$ D: int 1 2 3
$ E: chr "tsv" "tsv" "tsv"