PNHP / COA

Pennnsylvania Conservation Opportunity Area Tool development scripts
GNU General Public License v3.0
2 stars 1 forks source link

badly formatted dates in the SGCN points layer #42

Closed ChristopherTracey closed 7 years ago

ChristopherTracey commented 7 years ago

ugh... it makes extracting the recent records nearly impossible. working on reformatting them.

ChristopherTracey commented 7 years ago

Fixed via this R code:

# code to fix dates to the yyyy-mm-dd format...
library(lubridate)
setwd("C:/Users/ctracey/Dropbox (PNHP @ WPC)/coa/datefix")
points <- read.csv("points.csv")
myvars <- c("OBJECTID","SNAME","LastObs")
points <- points[myvars]
points$new_lastobs <- as.Date(parse_date_time(points$LastObs,"mdy")) 
points$new_lastobs <- as.character(points$new_lastobs)
write.csv(points, "updated_dates.csv")

Joined it back up to the GIS table and recalculated those dates.