Browse Source

modifications (probably pointless, as the date is missing from at least one other dataset)

Petra Lamborn 4 years ago
parent
commit
04b4675bfc
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      dataImport.R

+ 8
- 0
dataImport.R View File

@@ -1,3 +1,11 @@
1 1
 library(readxl)
2 2
 RAKETE_TOR <- read_excel("data/170202 RAKETE 16 11336 TOR xlsx.xlsx",
3 3
                          skip = 1)
4
+RAKETE_TOR$`Incident Time` <- sapply(strsplit(as.character(RAKETE_TOR$`Incident Time`), ' '), function(x) {
5
+  x[2]
6
+})
7
+
8
+RAKETE_TOR$`Incident Day` <- as.numeric(substr(RAKETE_TOR$`Incident ID`, 5, 6))
9
+
10
+RAKETE_TOR$TimeStamp <- as.POSIXct(sprintf("%d-%d-%d %s", RAKETE_TOR$Year, RAKETE_TOR$Month, 
11
+                   RAKETE_TOR$`Incident Day`, RAKETE_TOR$`Incident Time`))