Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
0answers
6 views

instead of using mahalanobis distance can I use euclidean at MRF and MCMC functions definition module? [on hold]

rm(list=ls(all=TRUE)) #mean of the training samples have to be generated before starting the process. require(rgdal) require(mvtnorm) require(rgl) StartPath <- getwd() # Set path to directories ...
1
vote
1answer
33 views

Convert shapefile to WGS84

I have a shapefile with shapelength and shapearea, and would like to convert to WGS84 to use with ggmap. Eventually, I would like to get plot google map of individual regions of the shapefile, and ...
2
votes
2answers
16 views

Save and load maps for ggmap to use without internet access

I would like to use the ggmap package to download and display maps. Unfortunately I have some firewall restrictions preventing R from accessing the internet directly. The error I get from get_map is ...
0
votes
1answer
21 views

Add Points shp attributes to Polygon shp by Point location (as Spatial Join in ArcGIS)

I have a set of points in .shp (ESRI, available here: http://ulozto.cz/xGqRVFrR/voronoi-zip). I would like to calculate Voronoi tesselation from the points, thus create polygons. So far, so good. ...
1
vote
0answers
22 views

rgdal with multiple Feature Datasets in R

I am trying to read shapefiles contained within a geodatabase file (.gdb) into R. The .gdb contains two Feature Datasets with multiple Feature Classes within each. The problem is only one of the two ...
2
votes
1answer
59 views

R - How to “smooth” a raster map

I am trying to create a map from raster data. The file came from a crop model, with resolution of 0.5 degree. Even when I disaggregate it (i.e. increase spatial resolution), the map looks really ...
0
votes
0answers
19 views

Krige function in gstat cannot see explanatory variables

I have a SpatialPointsDataFrame in R which I wish to interpolate using the krige command in gstat. When I use ordinary kriging (krige(Var~1)) the code runs fine. When I want to use universal kriging ...
1
vote
0answers
16 views

Problem with regression kriging using the krige command in r

I want to perform regression kriging in R using gstat. I have a SpatialPointsDataFrame which is of this form: After I have run my glm model, in order to see which variables are statistically ...
1
vote
3answers
26 views

Creating a new raster layer based on mean of other raster layers, ignoring NA values in R

I am trying to create a new raster layer that is made up of the mean values from 7 other raster layers. I get results using overlay function mean: mean <- overlay(2000, 2001, 2002, 2003, 2004, ...
0
votes
0answers
19 views

plot rasters with the same line diagram

I have 6 raster files with continuous values for an area with the same extent. I have created a raster stack and I want to plot one line for each cell in the raster stack of my six rasters (like the ...
0
votes
0answers
24 views

Using R to find attributes of spatial neighbors, especially with big spatial polygon data frames

If it's not too much, I have a specific question that leads to a more general one: I'd love thoughts on both if it's possible. First, the specific: I have an analysis involving census blocks and ...
0
votes
1answer
42 views

Cross validation in thiessen polygons interpolation

I apply Thiessen Polygons interpolation using the krige command in the gstat R package. Using krige without a variogram model sets automatically krige function to perform IDW, and when nmax parameter ...
4
votes
2answers
142 views

Calculating Shannon's diversity using moving window in R

I have a raster where each pixel is a particular vegetation type. I'm interested in the diversity of vegetation types around each pixel. I'd like to assign a Shannon's diversity index value (see ...
3
votes
2answers
33 views

writeOGR with a spatialpolygon simplified by gSimplify

I'm using gSimplify (rgeos package) to simplify the geometries of a shapefile. The funcion works good, but now I can't write the output in a new shapefile. I tried some ways: writeOGR(simplyshape, ...
0
votes
0answers
12 views

Dynamic polygons grid with specified area based on raster

I'm interested if anyone have idea how to automatically create (maybe in R?) dynamic grid of polygons with specified approx. area (for example around 20000 m2) based raster data or points with values ...
0
votes
1answer
38 views

in R : get a SpatialPolygonDataFrame from gIntersection{rgeos] with sub-area as attribute?

I am using gIntersection (package rgeos) to intersect a polygon shapefile containing 20 buffers zones, with another polygon shapefile containing "ground occupation mode (GOM)" (an area divided in ...
2
votes
0answers
21 views

Spatial weight matrix with boundary effects in R?

I need some help to finalize code for a spatial weight matrix that uses a nearest neighbor definition within regions, but does not allow neighbors from across a political border. For example, ...
0
votes
2answers
25 views

How to produce a finer resolution spatial grid from coarser grid in R?

I have a spatial grid of an image. Now I want to use this grid and make a finer resolution grid out of it. For example an image structure in R is given below: str(c) Formal class ...
0
votes
0answers
15 views

Why does R(gdal) mangle data when converting to geojson?

I've encountered issues with projections in .geojson files created by rgdal, but I never thought it would destroy my data, until I tried this (reproducible example): ...
0
votes
1answer
36 views

How to choose a shapefile interactively in R

I am writing a function in R where i want the user to choose a Esri shapefile from its destination folder. Since a shapefile is made of several files how can i select them. For a point feature class i ...
1
vote
1answer
25 views

How to read feature class in file geodatabase using R?

I have a feature contained in a geodatabase that is larger than 2GB as an exported shapefile. I need to run an extract function in R to attribute the polygons with data from a raster file. Exporting ...
3
votes
3answers
45 views

Lines on reprojected sp objects with Mollweide projection

I'm having an odd problem such that when I reproject maps to a Mollweide projection in R using sp, I get additional lines stretching across the globe. What is going on here, and do you have any ...
0
votes
0answers
15 views

Thin Plate Spline interpolation

I am completely new to spline interpolation, and I want to apply Thin Plate Spline using the fields package in R, and after I have applied Tps then do leave-one-out cross validation. This is how my ...
0
votes
0answers
16 views

How to reference to user input in SQL string in R?

I am building a R Shiny interface that queries the user input in Postgresql and generate the respective map layer. However, I am unsure of the syntax to include the query in the SQL string. my codes ...
1
vote
0answers
19 views

No output when rendering GeoJSON using Leaflet() package in RShiny

I am creating a Rshiny interface on that can take in the user input when a user click on a point on the map, query the user's selection from postgresql and return another map layer. The package I am ...
0
votes
0answers
23 views

How to convert a geojson from Postgresql to geojson format readable in rCharts in R?

I am creating a Rshiny interface on that can take in user input and SELECT the respectively map layer from Postgresql database based on the input. The package I am using to plot the map is rCharts. ...
-2
votes
1answer
30 views

I need to create a function in R that processes rasters in esri grid format [duplicate]

I have loads of data (6500 files that I need to process and find yearly winter sums/averages/variance for. the format for my naming system is Syyyymmdd_rp. Each file is in the same file folder. I ...
1
vote
2answers
39 views

Getting attribute table from WFS data source

I am attempting to get some WFS 2.0 INSPIRE data from the Finnish meteorological institute into a table format of some kind. Is there any software which can easily grab the attribute data for the WFS ...
0
votes
1answer
15 views

Calculate mean for a each object of SpatialPointsDataFrame

I have a list with several SpatialPointsDataFrame objects, and each object has certain slots. How can I calculate the meann value of a certain slot for every object in the list, and then save that ...
0
votes
1answer
21 views

Compare two rasters in R with the cell value from one replacing the cell value from another

I am trying to create a single raster from two rasters. The first raster is made up of all 0 values and the second is made up of the current date value (formatted in days from 001 to 365). The problem ...
0
votes
1answer
45 views

IDW in R with cross validation

I want to perform IDW interpolation using R, and more specifically, using the idw command from the gstat package. Also, I want to use the optimal number of neighbors (point locations) and distance ...
0
votes
1answer
22 views

GlobCover 2009 dataset - importing legend and colormap values into R

Does anyone know how to import a legend for a raster layer (loaded as a .tif) into R such that it can be attached to the raster file itself and used in plotting? In this case, I am using the GLC2009 ...
0
votes
1answer
27 views

Compare two rasters with raster overlay and replace cell value with variable

I want to compare 2 rasters and when there is a change from 2 to 1 create a new raster that replaces the cell where the change has been detected with the change variable. ## Finds Cells that have ...
3
votes
0answers
32 views

Why does @data@values slot for RasterLayer only contain logical(0) and not the actual values?

Trying to get to the bottom of why, when I read in a raster of NDVI, the @data@values slot does not contain the actual values until I set them manually. For example: NDVI <- ...
3
votes
1answer
74 views

Processing large amounts of Rasters in R

I have 6500 processed and clipped rasters that indicate snow levels on a daily basis in the northern hemisphere. I need to create a raster that represents a sum of the snow for the season. The winter ...
1
vote
2answers
45 views

Aggregate SpatialPoint to form SpatialPolygon

Is it possible to convert SpatialPointDataFrame to SpatialPolygonDataFrame by some kind of generalization or aggregation function in R. how can i form polygons from points of similar color/classified ...
1
vote
1answer
24 views

Trying to limit my shapemap to state boundary lines in R

I have a feeling I'm either trying to do this incorrectly, or I'm just not searching for the correct terms, but I cannot figure out how to do what I want to do. I am trying to plot the ranges of fish ...
1
vote
1answer
23 views

Workflow for updating raster using polygons of different attributes

I require a specific output but it is proving difficult for me to work out a workflow. I have: 1) polygons of new housing developments (356, non overlapping) 2) a 25m raster of land cover I want ...
2
votes
1answer
21 views

Last SEXTANTE (Processing) update results in missing RScripts examples

I have installed today the new version of the Processing plugin on QGIS 2.8 (on Windows 7 x64) and I cannot anymore find the RScripts example that were available (and functioning) before the udpate. ...
2
votes
1answer
21 views

Mosaic rasterstacks based on minimum of certain layer?

I am trying to mosaic 42 remote sensing rasterstacks (with 250 bands) based on the criterion that in overlapping areas, the pixel should be taken that has the most nadir viewing angle Beside my ...
0
votes
0answers
5 views

Using errorsalm() from spdep with multilevel data?

I have a dataset that has multiple observations per county, and I am interested in estimating the effect of a county-level variable on individual-level outcomes. I would like to account for adjacency ...
0
votes
1answer
39 views

Switch an R script from “MODIS Reprojection Tool” to “ModisSwathTool”

This R script works with MRT (MODIS Reprojection Tool), and its performance is unbelievable for land data. The only problem is when you use Atmospheric data from Modis, like "MOD05_L2". The problem ...
0
votes
2answers
72 views

R Spatial Kernel Density Estimation

I am new on spatial kernel density estimation with r and need some suggestions. Saying, I like to estimate the density for some event occurring at a location, for example, the probability of ...
2
votes
2answers
75 views

Use GRASS through R

I want to use GRASS GIS 7 through R 3.1.3 in kubuntu operational system. Could someone help me connect GRASS with R, and use GRASS commands through R (not the other way round!).
0
votes
2answers
57 views

How to get average values per coordinates in ArcMap/R?

I have a point shapefile. It has multiple points at different spatial locations. Within each point there are multiple values that I want to get the average of. In this case the new file would have one ...
1
vote
1answer
22 views

How to create a Planer Point Pattern in R using a Shapefile of point features

I have just started to learn spatial analysis of point pattern with R. On page 20 of this book, the "Swedishpines" dataset has been used for inspection purposes. However, I want to use my own dataset ...
3
votes
1answer
55 views

Obtaining sink morphometry from local minima points

I am working on LiDAR data from GIS and R and I want to extract landforms from the DEM. I have found a method to obtain local minima points of my LiDAR data. However, I would like to obtain the ...
0
votes
0answers
35 views

Total area of polygons over latitudes

I'd like to calculate the total area of several polygons along a north-south axis. A bit like this http://www.closr.it/canvas/1307/#/spot There is a similar question with R : Spatial graphing, ...
0
votes
0answers
22 views

how to assign the same centroid to polygons grouped by ID , R

I have a SpatialPolygonDataFrame object from a shapefile of different zip codes in New York state, many zip codes are represented by several polygons( for different reasons) so I want to assign the ...
1
vote
0answers
46 views

Simulate water runoff to get water height over each pixel of DEM

Here is my problem that I am trying to deal with. I have given a height map of around 512X512 resolution(It is Geo-referenced and I have the meta-data for this). And I have given that this area ...