What is the fastest way to get the local timezone in text of a large dataset of coordinates? My current method works fine, but the package I'm using "rundel/timezone" (which is simple and great for small sets) is quite slow for large sets.
Is there a faster way to accomplish the task reproduced below?:
library(data.table)
#REPRODUCE DATA
data <- data.table(latitude=sample(seq(47,52,by=0.001), 1000000, replace = TRUE),
longitude=sample(seq(8,23,by=0.001), 1000000, replace = TRUE))
###get timezone package via rundel/timezone
if (!require("timezone")) devtools::install_github("rundel/timezone")
library(timezone)
###CURRENT SLOW METHOD
system.time(data[,timezone:=find_tz(longitude,latitude),])
user system elapsed
49.017 21.394 74.086