Skip to content
Prev 12539 / 29559 Next

Time vs. Longitude (Hovmueller Diagram)

At a guess, for a given latitude you could do this where "x" is a
data.frame with columns Longitude, Latitude, Time1, ..., TimeN

x1 <- x["Latitude" == -29, ]

## very simplistically

## drop Latitude, and order by Longitude (assuming Time columns are in
the right order)
x2 <- as.matrix(x1[order(x1$Longitude),  -2]

image(x2)

## with a bit more work, but big assumptions

lon <- sort(x1$Longitude)
tm <- as.numeric(colnames(x2)[-1])

image(lon, tm, x2, main = "Latitude -29", xlab = "Longitude", ylab = "Time")


There's a lot of guessing here for us, can you describe the file more
exactly or provide a link to at least one latitude's worth?

The Spatial classes in sp provide much more structured support for
these grids, and the spacetime package even more for generalizing
further - but they rely on exactly regular grids, which it looks like
you have here.

Cheers, Mike.
On Wed, Aug 17, 2011 at 1:45 PM, Jianyun Wu <jianyun.fred.wu at gmail.com> wrote: