I have spatial temporal data: Daily measurements of 36 measurement stations for 425 days. I want to do some analysis with these data in R, so I just created a data frame from the data, which looks like this:
For each of the Stations X10004, X10007, ... I have the latitude/longitude values, but I do not know how to add these information correctly to the data frame in order to use the available analysis tools of R.
How to do it? Or should I use other data structure possibilities of R and how?
You need to melt your data into long format, and then merge. Once you've done that, you can use
ddply
/data.table
/ggplot
etc.In this case, think of
variable
as station in your data. And here is the dummy data I created: