Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
0answers
8 views

Kernel Density Analysis using R and ArcGis

I am doing some Kernel Density Estimations, and like everyone elese I face difficulties with setting the bandwidth to create georeferenced rasters. ArcGis (10.1) does it just fine, but it has no ...
2
votes
1answer
18 views

Plotting species distribution on map in R

I'd like to plot the distribution of a species on a map of Switzerland, following this tutorial. library(maps) library(mapdata) map('worldHires', 'Switzerland', xlim=c(5, 12), ylim=c(45,48)) From ...
0
votes
0answers
34 views

Unable to access R from QGIS 2.4

I have been unable to run R from within QGIS on my computer. I have R version 3.03 installed and QGIS 2.4 on Windows 7. R is located at C:\Program Files\R\R-3.0.3\bin\and this is the path e specified ...
3
votes
0answers
21 views

How to calculate 90% confidence interval in a raster stack

I have a stack of grid files (23) in ASC format from a MODIS sensor and I need to calculate a 90% confidence interval, mean, min, etc, for each one in R, how can I do that? specially the interval. ...
1
vote
0answers
27 views

QGIS using different R lib

I am working with a colleague who is learning QGIS and has a question about the R plugin. His library path (.libPaths()) has two folders: "C:/Users/RDCERWAW/Documents/R/win-library/3.0" "C:/Program ...
2
votes
0answers
32 views

Using R to subtract the polygon area of one shp file from another

I'm looking to produce a map from two separate maps in R. My Maps files are as follows: ftp://ftp.cpc.ncep.noaa.gov/GIS/us_tempprcpfcst/610prcp_20140822.zip #Map1 ...
1
vote
2answers
35 views

How to produce “SpatialPixelsDataFrame” from stacked RasterLayer?

How to produce "SpatialPixelsDataFrame" from staccked RasterLayer ? I have a stacked rasterlayer and I want to convert them to SpatialPixelsDataFrame. RasterLayer information is > RAD.all[[1]] ...
0
votes
1answer
29 views

going from hillshade to percent shaded (gdaldem)

I assumed hillshades output percent shaded (scaled to 255) at the given azimuth and altitude but this is incorrect. A flat raster at 80 degrees altitude has a maximum value of 251 instead of 255. How ...
1
vote
1answer
112 views

create the postGIS table error No such driver: PostgreSQL

I'm trying to create the postGIS table with spatial features I can do it by: library(RPostgreSQL) library(spacetime) library(rgdal) dbname = "geodatabase" user = "postgres" password = "***" #password ...
2
votes
1answer
20 views

How to assign CRS to RasterLayer in R

I have a layer with coord. ref. : NA. How can I assign coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 to coord. ref. : NA? class : RasterLayer dimensions : ...
0
votes
3answers
116 views

Import shapefiles on my postgis table using R

Using R, I would like to import shapefiles that are in a directory on a geometric table i have on postgresql / postgis. What is the instruction that allows me to do it? EDIT: here is my code to ...
3
votes
1answer
50 views

Max cell value from a stacked raster

How can I find a max cell value from a stacked raster. Rmax <- maxValue(RAD1998.all[[1]]) works fine but Rmax <- maxValue(RAD1998.all[[2]]) gives NA. Of course not in a stacked raster. ...
3
votes
1answer
51 views

How to overlay a county boundary on a raster file?

I want to overlay California county boundary top of raster layer. Here is is my code: data(coastsCoarse) data(countriesLow) library(gtools) library(maps) library(maptools) library(sp) # Raster ...
3
votes
2answers
48 views

How are kappa and overall accuracy related with respect to thematic raster data?

I recently calculated kappa (using confusionMatrix{caret} in R) between a thematic raster dataset at 1m spatial resolution and another at 30m spatial resolution. I was interested in quantifying the ...
2
votes
2answers
71 views

Join CSV file to shapefile

I wanted to join a CSV file to a shapefile. When I identified a field to facilitate the join, e.g., map <- spChFIDs(map, as.character(map$ID)) it returned Error in spChFIDs(SP, x) : ...
1
vote
1answer
33 views

Counts the number of points in a polygon in R

I have two classes sharing the same CRS (Latitute and Longitude): bolognaQuartieriMap: a SpatialPolygonDataFrame containing data of a city boroughts. crashPoints: a SpatialPointsDataFrame containing ...
2
votes
1answer
63 views

Levelplot(RasterVis) two marginal plot scale?

How can I add/display scale to two marginal plot? RAD1998.all <- stack(list.ras) list.files <- mixedsort(list.files(paste(getwd(), "/1998bil/", sep = ""), full.names = F, pattern = ...
1
vote
0answers
39 views

Monte Carlo test of Space-Time clustering in R

I have several point patterns representing the distribution of territories of a bird species. Each point pattern represents the distribution of one year. I already succeeded in computing Ripley's L ...
0
votes
1answer
49 views

levelplot index issue

levelplot with static index works fine but not in a for loop. What's wrong with my code? Static index: png(paste("1998",outlist[[1]],".png",sep="")) levelplot(RAD1998.all[[1:4]]) dev.off() ...
0
votes
2answers
61 views

R -plot 12 images per plot or save 12 images per image file in R

Here is R script and my question is How can I plot 12 images per plot or save 12 images per image file because I have total 864 images. RAD1998 <- raster(paste(getwd(), "/1998bil ...
2
votes
0answers
50 views

Variogram model fit compatability among geoR, gstat, and nlme packages in R

I'm trying to specify the covariance structure parameters in a linear mixed model (using the correlation structure facilities in nlme). The parameters are estimated from a gstat or geoR variogram ...
2
votes
1answer
64 views

How to remove columns in a spatial polygon data frame in R?

My spatial polygon data frame (spdf) contains too many columns (variables) and I want to remove most of the columns entirely. I know how to do this with a regular data frame in R, but I am unsure how ...
4
votes
1answer
176 views

How to 'reverse clip' (erase) in R

A reverse clip saves only the part of your spatial object that is outside the bounds of another object, as opposed to a regular clip which saves the parts that are inside the other object. Here's how ...
1
vote
0answers
28 views

spatialpolygons heatmap in R - NAs in grey?

I have a spatial polygon data-frame and I am trying to plot a heatmap via spplot. It's a map of Europe and the values for the heatmap are in a column of the data-frame. Plotting it works fine but I ...
1
vote
0answers
20 views

Not able to bulk download MODIS images

I am trying to download Modis NDVI and EVI images. I have used the following R-code: setwd("/home/karthik/Valmiki/Modis_bands/") library(raster) library(RCurl) ...
3
votes
0answers
35 views

Multispectral image segmentation for natural-resources applications using R

R has the capacity for image segmentation, although all of the examples I have come across utilize a single band for the segmentation (example). I am interested in combining R's capacity for random ...
1
vote
0answers
14 views

(R)SAGA: saga_cmd 2.1.0 error? inconsistency?

frequently I am using (R)SAGA, but after SAGA became >2.1.0 the R package is no longer working. The last update for RSAGA was 07/2013. Thus I downgraded SAGA to 2.1.0 (first try was skipping the ppa ...
2
votes
1answer
24 views

How to read ASTER metadata in IDL?

I'm trying to read many ASTER images (1B mainly) in IDL (I can try in R also). I'm used to work with Landsat, but the aster metadata is complicated. I write a code with a lots of conditional that can ...
2
votes
1answer
52 views

Are there examples of high-level interfaces to NetCDF

The R raster package and GDAL both have independent wrappers around NetCDF-4* that treat an array variable as a "complete" dataset, i.e. they provide objects or interfaces that seamlessly give access ...
4
votes
0answers
18 views

Classical or robust variogram for incorporation into generalized linear model

I'm modeling counts of organisms over time at eleven locations. I'd like to account for temporal autocorrelation in the counts, assuming it's present. As the data are not equally spaced in time, ...
1
vote
0answers
74 views

What's the difference in these two shp files?

I'm trying to plot points on these maps in R, with points from "Coordinates" in the same folder. The WL.shp plots fine with the data, but the NG.shp (which should only be larger and of the same area ...
0
votes
0answers
23 views

Neighbours list extracted out of polygon regions

I've got a SQL database which contains some coded polygon structures. Those can be extracted as follows poly <- data.frame(sqldf("SELECT ST_astext(geometry) FROM table")) The data.frame 'poly' ...
1
vote
1answer
39 views

R giving error when attempting map algebra

I'm trying to manipulate some downloaded rasters using R, and keep getting the same error when I try to do any type of map algebra. The example below uses a raster file downloaded from ...
1
vote
0answers
21 views

How to calculate average raster values around a set of points (ArcGIS or R) [duplicate]

I have a 30-m elevation raster as well as a set of points that overlay the raster. For each point, I want to calculate the average elevation within a 5-km radius of the point. One way I was ...
3
votes
1answer
60 views

How to create randomly points within polygons for each row of a dataframe matching a Polygon ID with R

My question is similar to this post, but because there are no "perfect" answer and above all no reproducible example I open this question. I have a "SpatialPolygonsDataFrame" and a data frame. Both ...
3
votes
1answer
58 views

Projection mismatch when plotting precipitation with ggplot

I'm trying to plot accumulated precipitation in Brazil for a given period, see code below: Load packages library(raincpc) library(SDMTools) library(raster) library(ggplot2) library(rgdal) ...
0
votes
0answers
69 views

NAs not allowed error message in attempt to plot raster object in R

I have imported a clipped raster (performed in ArcGIS 10.1) from the National Landcover Dataset into R, but when I try to plot I get the following error message. Error in .readCellsGDAL(x, ...
2
votes
0answers
86 views

Doubts with Ripley's K function Interpretation

I'm a self-taught person, I'm studying the K Ripley's function and I would need some person who give me some advices. First, I have written a little script of R in QGIS processor: ##Point pattern ...
0
votes
1answer
75 views

Reproject MODIS level 3 chlorophyll data using gdal

I am trying to reproject MODIS Level 3 chlorophyll data (for instance, this file) using gdal in R. I used gdal_translate and gdalwarp functions. There was no crs information associated with ...
1
vote
1answer
25 views

R SP library: identicalCRS and parameters in different order

The following returns FALSE: library(sp) points <- matrix(rnorm(30, 50, 10), ncol=2) proj1 <- CRS("+proj=utm +zone=10 +datum=WGS84 +ellps=WGS84 +units=m +no_defs +towgs84=0,0,0") proj2 <- ...
3
votes
0answers
31 views

Spatial interpolation with breaklines in R

I have a dataset consisting of irregularly-spaced points (x,y,value) that represent an area of ocean that contains some land. I need to interpolate these to a regular grid, ensuring that the ...
0
votes
1answer
36 views

Cannot properly import MODIS MOD07_L2 .hdf files into R using rgdal

I've been trying to accurately import and process some .hdf files from the MODIS Atmospheric Profile product (MOD07_L2) in R for several days now. Still, there's something going wrong during data ...
1
vote
0answers
27 views

R{raster} getValues(): error accessing values of large raster

I am getting the following, while extracting all values with: rs<-getValues(rster) Error in getRasterData(con, offset = offs, region.dim = reg, band = object at data@band): long vectors not ...
2
votes
0answers
37 views

R: Can raster predict function pass to predict.rfsrc (a prediction function in a parallel verion of RandomForest)?

It seems that raster predict function can pass to predict.randomForest by setting the "type='response'". I am using a parallel version of randomForest package called the "randomForestSRC" and I am ...
0
votes
2answers
36 views

How to find variable names for SF1 Census files

I'm trying to to read the 2010 Census data so that I can link some of my research data to geographic information. Ideally I would like to use census tract data and other covariates. I've downloaded ...
2
votes
2answers
70 views

How to determine in which grid cell each coordinate of an x,y series is located?

I have a circular arena which I have divided into a number of equal-sized 'cells' using a grid-like arrangement of concentric circles and line segments (in grey below) and also a series of x,y ...
2
votes
2answers
58 views

Display two-dimensional color gradient for two different quantities

I have two overlapping raster layers. One contains quantity A from 0 to 100, and the other contains quantity B from 0 to 100. I'd like to create a map displaying both sets of data at once based on a ...
4
votes
1answer
71 views

How to mosaic rasters in R?

I am trying to mosaic several rasters into single big raster in R. Using script that posted in http://stackoverflow.com/questions/15287807/how-can-i-create-raster-mosaic-using-list-of-rasters But, I ...
1
vote
0answers
45 views

How do I convert a .bil (and associated .clr, .blw, .hdr, and .stx) files into georeferenced rasters in R? OR to geotiffs using gdal_translate?

The title says it all. I've got a bunch of .bil files, which I can open in R using the raster command pointed to the path to the .bil file. But I don't know how to efficiently incorporate the ...
0
votes
1answer
69 views

projection conversion from mercator to google maps format

Is this spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 ")) the right way to project a shapefile with this projection coord. ref. : +proj=merc +lon_0=0 ...