[R-sig-Geo] Space-time movement Trajectory on a hovmoller plot

Frede Aakmann Tøgersen frtog at vestas.com
Mon Oct 27 15:08:25 CET 2014


Hi Navinder

You are starting a new thread here so I guess it is somewhat impolite of you to sort of requesting help from Oscar by including him on CC (so I have deleted from the CC).

Also please provide some code. Don't expect that people will respond to your questions if they have to do more involved work in order to show how to do the job.

The easiest answer from me to your question is to use some of the methods that Oscar and I already have shown you. Since a hovmoller diagram is based on the lattice functions contourplot() and levelplot() then you can use something like

hovmoller() + xyplot().

Yes that is easy. In any case here is an example from the man page of hovmoller():

library(rasterVis)
library(latticeExtra)
library(zoo)

url <- "ftp://ftp.wiley.com/public/sci_tech_med/spatio_temporal_data/"
sst.dat = read.table(paste(url, "SST011970_032003.dat", sep=''), header = FALSE) 
sst.ll = read.table(paste(url, "SSTlonlat.dat", sep=''), header = FALSE)

spSST <- SpatialPointsDataFrame(sst.ll, sst.dat)
gridded(spSST) <- TRUE
proj4string(spSST) = "+proj=longlat +datum=WGS84"
SST <- brick(spSST)

idx <- seq(as.Date('1970-01-01'), as.Date('2003-03-01'), by='month')
idx <- as.yearmon(idx)
SST <- setZ(SST, idx)
names(SST) <- as.character(idx)

### dummy points
somepoints <- data.frame(Time = as.yearmon(seq(as.Date("1980-01-01"),as.Date("1990-01-01"),by="6 month")),
                         Latitude = -10:10)

hovmoller(SST, panel=panel.levelplot.raster,
          xscale.components=xscale.raster.subticks,
          interpolate=TRUE, par.settings=RdBuTheme) +
              xyplot(Time ~ Latitude, data = somepoints, pch = 19, col = "black", cex = 1)
  

Yours sincerely / Med venlig hilsen


Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender. 


> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-
> project.org] On Behalf Of Navinder Singh
> Sent: 27. oktober 2014 13:50
> To: r-sig-geo at r-project.org; Oscar Perpiñán Lamigueiro
> Subject: [R-sig-Geo] Space-time movement Trajectory on a hovmoller plot
> 
> Dear List,
> Is there a way to plot spatio-temporal x,y/long-lat co-ordinates over a
> hovmoller diagram available in the rasterVis package.
> I have some animal movement data which has x,y and time (as.Date) object
> attached to it and is from the same time period as snow.
> Now i have created a �hovmoller� plot from the rasterVis with interpolated
> snow data for an entire year with daily resolution and would like to overlay
> the animal locations during that period with respect to snow.
> Is there a straightforward way to do it by using sp/raster/rasterVis/�.
> Thanks,
> Navinder
> 
> 
> 
> 
> 
> Navinder J Singh
> Associate Professor
> Department of Wildlife, Fish, and Environmental Studies
> Faculty of Forest Sciences
> Swedish University of Agricultural Sciences
> SE-901 83 Umea, Sweden
> O: +46 (0)90 786 8538;
> M: +46 (0)70 676 0103
> email: navinder.singh at slu.se<mailto:navinder.singh at slu.se>
> Web: navinderjsingh.weebly.com<http://navinderjsingh.weebly.com/>
> 
> www.slu.se/viltfiskmiljo/navinder_singh<http://www.slu.se/viltfiskmiljo/na
> vinder_singh>
> http://slu-se.academia.edu/NSingh
> 
> 
> 
> 
> 
> 	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list