[R-sig-Geo] Raster Prediction with factors in model

2015-04-20 Thread Mark Payne
Hi, I have a GAM model that contains factors in addition to smooth terms etc. I would like to evaluate this at all points on a raster, but I can't seem to get the predict.raster() function to pick up the values of my factors. I have created a minimum (not) working example here, based on the

Re: [R-sig-Geo] writeRaster does not preserve names when writing to NetCDF

2014-08-12 Thread Mark Payne
, of characters, to the NetCDF file, but I suspect keeping to a given NetCDF Convention would be a good idea assuming it can do it. End-of-ramble... Barry On Tue, Aug 12, 2014 at 12:26 AM, Mark Payne markpayneatw...@gmail.com wrote: Hi, I have a problem with writeRaster when

[R-sig-Geo] writeRaster does not preserve names when writing to NetCDF

2014-08-11 Thread Mark Payne
Hi, I have a problem with writeRaster when writing a brick to NetCDF - the names of the layers are not preserved. Here is a minimum example to demonstrate the point: #Create an arbitrary brick and write it out b - brick(system.file(external/rlogo.grd, package=raster)) fname - file.path(

Re: [R-sig-Geo] raster - 4D Bricks

2014-07-30 Thread Mark Payne
. ref. : NA data source : C:\temp\test-1.nc names : X1 z-value : 1 zvar: a level : 1 Warning message: In .rasterObjectFromCDF(x, type = objecttype, band = band, ...) : level set to 1 (there are 2 levels) On Tue, Jul 29, 2014 at 7:43 PM, Mark Payne markpayneatw

[R-sig-Geo] raster - 4D Bricks

2014-07-29 Thread Mark Payne
Hi, I have a 4D climate model output that I am trying to work with via raster, and that is unfortunately giving problems. I create the object as a brick: b class : RasterBrick dimensions : 220, 254, 55880, 756 (nrow, ncol, ncell, nlayers) resolution : 1, 1 (x, y) extent : 0.5,

[R-sig-Geo] Spacetime variogram - non square cells

2014-06-06 Thread Mark Payne
Hi, I have a space-time array derived from (patchy) satellite data that I am trying to do space-time kriging on. However, I'm not having much success with trying to calculate the variogram. In particular, I get the following error: vg - variogramST(logchl~1,location=dat) | | 0% Error: gstat:

[R-sig-Geo] (Linear) interpolation in three (or more) dimensions

2014-06-03 Thread Mark Payne
Hi, I have a dataset that consists of satellite observations on a regular lon-lat grid at taken at regularly time pointts. Unfortunately due to cloud cover, there are gaps dispersed semi-randomly throughout the 3D data array. I would like to fill these gaps. The best solution I guess is

Re: [R-sig-Geo] Spplot: Specifying individual point symbols

2014-03-08 Thread Mark Payne
: http://oscarperpinan.github.io Twitter: @oscarperpinan 2014-03-07 15:29 GMT+01:00 Mark Payne markpayneatw...@gmail.com: Hi, I have a problem where I would like to have both the colour and the symbol varying in an spplot plot. Unfortunately, specifying a list of pch values doesn't seem

[R-sig-Geo] Spplot: Specifying individual point symbols

2014-03-07 Thread Mark Payne
Hi, I have a problem where I would like to have both the colour and the symbol varying in an spplot plot. Unfortunately, specifying a list of pch values doesn't seem to work. See the following example library(sp) data(meuse) coordinates(meuse) - ~x +y #Lets plot the elevation spplot(meuse,elev)

[R-sig-Geo] Problem with raster

2014-02-21 Thread Mark Payne
Hi, I am having a problem with the following code - I'm trying to create a raster from a SpatialGrid, but there seems to be something going wrong along the way - the problem pops up when I try to build two rasterlayers into a brick: halfrect.grd - GridTopology(c(-22.75,36.75), +

[R-sig-Geo] Linking problem with rgdal

2014-02-04 Thread Mark Payne
Hi, I'm trying to install rgdal on a Scientific LInux cluster which I do not have administrator rights. So far, I have done the following * Downloaded and installed gdal from source into my home directory ie configured with ./configure --prefix=$HOME/R/gdal *Downloaded and install proj4 from

[R-sig-Geo] sp::makegrid() bbox does not fully cover object

2014-01-27 Thread Mark Payne
Hi, I have been playing with the makegrid function, and discovered something interesting. For example, consider the domain of the meuse data data(meuse) coordinates(meuse) - ~x+y bbox(meuse) minmax x 178605 181390 y 329714 333611 Now make a grid, and check its domain grd -

[R-sig-Geo] Remove holes from a SpatialPolygon

2013-12-31 Thread Mark Payne
Hi, I have a SpatialPolygon that I have created through a series of processing steps. The SP consists of one outer-boundary, with a series of holes punched in it - think of it as the coastline of an island with a series of lakes in it. However, I am only interested in the external coastline and

[R-sig-Geo] Combining spatial pixels objects

2013-11-19 Thread Mark Payne
Hi, Consider a situation where I have a spatialpixelsdataframe, m.subset, that is a subset of a larger dataframe, m. Due to the large size of my dataset, its more efficient for me to work on just this subset, than it is to work with the entire data set. Now, the question is, once I've finished

[R-sig-Geo] Getting started with geostatistics in R

2013-11-04 Thread Mark Payne
Dear R-sig-geo-ers, I was wondering if anyone could recommend a good entry-level reference on Geostatistics, particularly with an R flavour. I've read Roger Bivand's ASDAR book, and found it very useful, but I struggled a lot with the later chapters that came down to the actual nuts and bolts of

[R-sig-Geo] Area calculation workflow

2013-07-16 Thread Mark Payne
Hi, I have a SpatialGridDataFrame with sea-surface temperatures based on lon/lat coordinates that I want to use to calculate the area (in square km) contained within an isotherm. I'm still a little unsure in this type of thing, so just wanted to check that the workflow is correct. I can get the

[R-sig-Geo] Crop / clip a SpatialPixels* object

2013-06-22 Thread Mark Payne
Hi, This should be simple, but I simply can't find an elegant solution. I have a SpatialPixelsDataFrame that I would like to clip (crop) to a smaller object. For example, data(meuse.grid) m = SpatialPixelsDataFrame(points = meuse.grid[c(x, y)], data = meuse.grid) bbox(m) minmax x

[R-sig-Geo] Writing a rasterBrick into a single NetCDF file

2012-11-27 Thread Mark Payne
Hi, I have a rasterStack with several layers. I would like to write this into a single NetCDF file, where each layer is stored as a variable. Is there anyway that this can be done? At the moment (raster 2.0-31), the layers are written as a third dimension, rather than than as separate variables.