I'm looking to merge two vectors (time and location) to create a data frame that has all the times for every location. Below are the two vectors:
#Here are the hours
base_hours = seq(
from=as.POSIXct("2015-1-1 0:00", tz="America/New_York"),
to=as.POSIXct("2015-1-3 23:00", tz="America/New_York"),
by="hour"
)
#hypothetical locations
loc = c("woodside", "corona", "jackson heights", "flushing")
How do I merge them so that every location has every date in base hours? the final set would look something like this:
loc hours
woodside 2015-01-01 00:00:00 EST
woodside 2015-01-01 01:00:00 EST
woodside 2015-01-01 02:00:00 EST
corona 2015-01-01 00:00:00 EST
corona 2015-01-01 01:00:00 EST
corona 2015-01-01 02:00:00 EST
If I am understanding this correctly, something like this would work: