[R-sig-Geo] [raster] conserving dimensions when regridding a 4D Brick or Stack

2013-04-04 Thread Tom Roche
summary: When regridding a 4D Brick (e.g., the netCDF data variable Fraction_of_Emissions(TSTEP, LAY, ROW, COL) in > netcdf GFED-3.1_2008_N2O_3hourly_fractions { > dimensions: > TSTEP = 12 ; > LAY = 8 ; > ROW = 360 ; > COL = 720 ; > variables: > float Fraction_of_Emissions(TSTEP, LAY,

Re: [R-sig-Geo] Help converting matlab raster to R raster brick

2013-04-04 Thread Michael Sumner
Hi Craig, see the "array" method for ?brick: brick(x, xmn=0, xmx=1, ymn=0, ymx=1, crs=NA So, something like x <- brick(test$data[[2], xmn = min(test$data[[5]]), ymx = max(test$data[[5]]), ymn = min(test$data[[4]]), ymx = max(test$data[[4]])) You might need to mess around to get the x/y ranges

Re: [R-sig-Geo] rgdal and MSSQL Server geometries

2013-04-04 Thread cmundy
Hi Shannon, The other requirement to read tables from MS SQL Server is that details of the table with geometry columns must be registered in a table called geometry_columns in your database. If your database doesn't have this table, do the following; 1) write a small point or polygon object back

Re: [R-sig-Geo] rgdal and MSSQL Server geometries

2013-04-04 Thread Shannon E. Albeke
Craig, thanks for the idea. I did create a DSN using ODBC as well as using an explicit string connection. Both give me the same result of: 'Cannot open data source' Thus, I am thoroughly confused because I can connect to the SQL Server via all of my other methods (RODBC) and software with no is

Re: [R-sig-Geo] seemingly unresolved problem with predict() in package raster

2013-04-04 Thread Robert J. Hijmans
cforest with factors are currently not supported (although they may work in some cases). I will change the predict function to make it more general by adding a 'levels' argument such that you can indicate (for models with a non-standard structure such as cforest) which variables are factors and wha

Re: [R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Robert J. Hijmans
Hein, I think this problem goes away if you use a clean formula, like this: > model <- glm(t0~ycoord+prec+tempmean+tempmax+tempmin, family=binomial(link="logit"), data=c3p) Robert On Thu, Apr 4, 2013 at 7:42 AM, Jesse Berman wrote: > Hi Hein, > > I'm not sure if this will help, but one thin

Re: [R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Jesse Berman
Hi Hein, I'm not sure if this will help, but one thing to check is that your prediction grid has covariate data for each of the 40,000 cells. If a large number of cells have 'NA' as data values, then sometimes the prediction will not work. Offhandedly, it strikes me that ycoord may be limited to

[R-sig-Geo] Help converting matlab raster to R raster brick

2013-04-04 Thread cmundy
Hi All, I have been provided with a .mat file containing a time series of Sea Surface Temperature data (50 x 42 cells with 92 time layers). It was a "Struct" object in Matlab. I can happily import the file in to R using R.matlab, creating a list as follows. My question is how then to convert this

Re: [R-sig-Geo] rgdal and MSSQL Server geometries

2013-04-04 Thread cmundy
Hi Shannon, The following syntax has worked for me for the past year. projstring <- CRS('+init=epsg:28355') ##Establish the dsn # Note: use the odbc tool in Windows to create a dsn for your SQL Server database beforehand myMSSQLdsn <- c("MSSQL:server=mysqlservername;database=mydatabase;trusted_c

[R-sig-Geo] collect latitude/longitude of various countries

2013-04-04 Thread hnstedu
Dear list, How can I obtain the latitude/longitude of various countries? In addition, does anyone know how to calculate absolute latitude? wanhai Best regards [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-p

[R-sig-Geo] predict function of regressors in the raster package

2013-04-04 Thread Bouwmeester, Hein
Hi, I would like to make a raster, based on the regression coefficients with 5 other rasters (Predictors). In theory this should be easy using the predict function of the raster package (http://cran.r-project.org/web/packages/raster/raster.pdf). But I fail to get it to work. First I fit a glm

[R-sig-Geo] seemingly unresolved problem with predict() in package raster

2013-04-04 Thread Gonzalez-Mirelis Genoveva
Hi all, I have a problem with the function raster::predict very similar to the one described here [1], [2] using raster package version 2.0-41 and party package version 1.0-6, where my model is a conditional inference forest (party::cforest). Could not find a solution in either post. The p