Re: [R-sig-Geo] questions on RasterStack/Brick

2013-06-24 Thread ppanday
Hi Robert To create a map of significance of the correlation, I tried substituing the command cor with cor.test(x,y, method=method)$p.value However, I get an error asying "Error in .calcTest(x[1:5], fun, na.rm, forcefun, forceapply) : cannot use this function" Is it possible to use this func

[R-sig-Geo] read *.h5 data in R

2013-06-20 Thread ppanday
Hello, I am trying to use the 'h5r' package for reading HDF5 files. Can anyone show me what the best way to read the data in these files? Sample data is lcoated here:http://www.ntsg.umt.edu/project/et Thanks, Prajjwal -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/re

[R-sig-Geo] Create a mask with 1 deg latitudinal bands

2013-06-17 Thread ppanday
Hi, I am trying to create a mask within a specified extent [ext <- extent(-58,-48,-17,-2)] that has 1 degree latitudinal band masks. So every 1 degree is a different number category. Eventually, I want to use it in zonal (as a mask) to obtain zonal statistics. I have a way that is a bit roundabout

[R-sig-Geo] extract by polygon ID

2013-03-11 Thread ppanday
Hi I have a vector polygon which has 3 categories. I am trying to extract a raster(and rastergroup) using this vector and then summarize by the Id (3 polygon categories). Thanking ahead for any suggestions. Prajjwal > test.vec class : SpatialPolygonsDataFrame nfeatures : 1736 extent

[R-sig-Geo] Aggregate within another grid extent

2013-03-04 Thread ppanday
Hello I have a rasterbrick with MODIS 1km pixels for an study region. How do I aggregate all the MODIS pixels that fall within another raster layer with 0.5 degree resolution and take the average time series? There are not necessarily the same number of MODIS pixels within the 0.5 grid. Thanks, P

Re: [R-sig-Geo] Rasterbrick to netCDF

2013-01-31 Thread ppanday
http://cirrus.ucsd.edu/~pierce/ncdf/ ) but it may be easier to use the ncdf library instead. Robert On Thu, Jan 31, 2013 at 11:21 AM, ppanday <[hidden email]> wrote: > Robert > > Yes, the ncdf4 packages works fine. However, it seems it runs in the unix > environment currently. Than

Re: [R-sig-Geo] Rasterbrick to netCDF

2013-01-31 Thread ppanday
quot; is the actual contents of the original netcdf > file > var_out <- ncvar_def('precipitation', 'mm/day', > list(dim_lon,dim_lat,dim_lev,dim_time), 9.e20) > ncid_out <- nc_create('updated_netcdf.nc', var_out) > ncvar_put(ncid_out, var_out, data, start=c(1, 1, 1, 1), count=c(720,

[R-sig-Geo] Rasterbrick to netCDF

2013-01-24 Thread ppanday
Hello I have an output from R-script in the form of a rasterbrick with 3 dimensions (time, latitude, longitude). I want to be able to write it to a netCDF format, add another dimension (time, level, latitude, longitude), and be able to edit dimension attributes. Below you will see the properties w

[R-sig-Geo] loading all levels and time in netCDF using brick/stack

2013-01-08 Thread ppanday
Hello all I have a netCDF file with 42 levels across time. Is it possible to load using brick or stack both levels and time dimensions? Using brick option, I can only load either all time or all levels? Is it possible to work with both dimensions so that if I need to average across levels, across

[R-sig-Geo] raster extraction

2012-12-27 Thread ppanday
Hello all I have a raster bricklayer with 30 layers. Is there a way to extract area-average using a raster mask? Or if I have the same layer already masked, how would I compute area-average for the bricklayer? My other questions is if I have a raster bricklayer with 360 layers (months), how would

Re: [R-sig-Geo] Runtime error when opening netCDF

2012-12-19 Thread ppanday
Robert, from what I understand, use raster package in 32-bit to open and write as a new netCDF file (using writeRaster) and then open in 64-bit using ncdf. This way I should be able to bypass size limit issue if I come across large datasets. So far, I have read the netCDF file as raster using brick

Re: [R-sig-Geo] Runtime error when opening netCDF

2012-12-19 Thread ppanday
Robert Yes I was able to read the file using ncdf. However, I am not able to load the entire variable in R-32bit using get.var.ncdf command. I get the error "cannot allocate vector of size 2.5 Gb". Also, would this be a problem down the road if I am working with large datasets in R-32bit? Thanks,