[R-sig-Geo] Aggregate time series grid data temporally
Oscar Perpiñán Lamigueiro
oscar.perpinan at upm.es
Mon Mar 12 12:34:23 CET 2012
senani karunaratne <senawusl at yahoo.com> writes:
> Hi Ping,
>
> You can read your grid files to R.
>
> Recently I read monthly grid data for time series and they can be stacked in R.
>
> Use package Raster for stacking purpose. Code I used is given below
>
> setwd ("D:\\WORKINGS")
> # check your data in folder
> dir()
> library (raster)
> # list all files of interest:
> weather<- list.files()
> # Read to R:
> require (raster)
> stacked <- stack (lapply(weather,raster))
>
> Look for help file of the raster package where you can get aggregates etc
> This approach is very simple and it works for me.
Besides, the 'setZ' and 'zApply' functions of the 'raster' package could be useful for you since
you are using raster time series.
Best,
Oscar.
>
> Date: Sat, 10 Mar 2012 07:52:21 -0700
> From: ping yang <pingyang.whu at gmail.com>
> To: R-sig-Geo at r-project.org
> Subject: [R-sig-Geo] Aggregate time series grid data temporally
> Message-ID:
> <CAK8gSG_iuc_bZ6jVOy_YMAb_Rn9Qb4e_9jMK7kwr+VTn919_gg at mail.gmail.com>
> Content-Type: text/plain
>
> Hi,
>
> I am a newbie of R, I have time series (6 hours) weather data(represented
> as muti-layer grids), what I plan to do is to aggregate these grids
> temporally(from 6 hours to daily), Can I do it with R? some instructions or
> suggestions?
>
> Thanks,
>
> Ping
> ----------
> Ping Yang, Ph.D.
> Postdoctoral Research Associate
> CUNY EnVironmental Crossroads Initiative
>
> senani karunaratne
> University of Sydney
> Australia
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Oscar Perpiñán Lamigueiro
Dpto. Ingeniería Eléctrica
EUITI-UPM
http://procomun.wordpress.com
More information about the R-sig-Geo
mailing list