Last active
January 6, 2016 23:01
-
-
Save black-tea/f73a9571802cc9723f74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(data.table) | |
### Inputs ### | |
meta.file <- "Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/config.dsv" | |
### Load Data ### | |
meta.df <- fread(meta.file, header=T,sep="|",stringsAsFactors=F) | |
### Clean XY Data ### | |
x <- gsub('.+\\((-[0-9]+\\.[0-9]+) {1}([0-9]+\\.[0-9]+).+','\\1',meta.df$START_LAT_LONG) | |
y <- gsub('.+\\((-[0-9]+\\.[0-9]+) {1}([0-9]+\\.[0-9]+).+','\\2',meta.df$START_LAT_LONG) | |
meta.df$START_LAT_LONG <- NULL | |
meta.df <- cbind(meta.df,x,y) | |
### Export to CSV ### | |
write.table(meta.df,file="Z:/GIS/DataLibrary/Riits/TrafficVolumes/data dump/EXPORT - 2015/config-CLEAN.csv",sep=",",row.names=FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
modified for space instead of comma btw coords