Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
39 views

How do you extract the mean fire frequency (raster) for each point within a given buffer size using R?

I am trying to extract fire data (mean and max fire frequency) for each point within a given buffer size (250m) around multiple points. Currently, my point data is in Lat and Long. For the raster ...
1
vote
2answers
46 views

Copy resolution extent CRS metadata from one raster file to another using raster R

I have two geotiff raster files, one has all the metadata information and in the other the information was lost. I know that all the metadata information was exactly the same so I want to copy it from ...
2
votes
2answers
35 views

Assigning column names dynamically

I have an interesting problem: I need to batchprocess a few files. I do that in a for-loop, where some operations are performed. Later on I want to write the outcome into an existing shapefile which ...
1
vote
0answers
11 views

Using 'Index-type' raster layers with negative values as independent variables in a multiple linear model in R

Using a multiple linear model I am trying to quantify the "effect" of abiotic landscape characteristics (slope, elevation, solar radiation, and a load of terrain indices) on vegetation greenness ...
1
vote
0answers
22 views

Computing intersection of distance circles around fixed points [duplicate]

(to simplify calculations, I assume a spherical earth. All distances are assumed measured "as the crow flies") Suppose we have the lon/lat coordinates for two points (p_1,p_2) less than Nkm apart. ...
3
votes
1answer
79 views

How to do operation after using over() for a shapefile in R?

I am copying the answer of Counts the number of points in a polygon in R library("raster") x <- getData('GADM', country='ITA', level=1) class(x) # [1] "SpatialPolygonsDataFrame" # attr(,"package") ...
2
votes
0answers
47 views

Determine if mapped points are related geographically

Hoping you can help. I'm a clinician trying to determine if some mapped points are related. I basically have a data set of certain long/latitudes. Each lat/long is associated with a positive Sputum ...
4
votes
1answer
65 views

Great circles path not curved (in R)? Conventions and convertions problems?

I am given the great circle equations of two paths. The first one is Longitude = 168 degree. and the second one is: tan(Lattitude)=.11 cos(Longitude) + .64 sin(Longitude) However, I am ...
4
votes
3answers
137 views

Read a table from an ESRI file geodatabase (.gdb) using R

I am trying to read a table directly from an ESRI file geodatabase into R. An example data file can be downloaded here. The database contains a point feature class (Zone9_2014_01_Broadcast) and two ...
3
votes
1answer
109 views

Identifying value of closest non-NA pixel

I have a raster representing a large landscape, where pixel values indicate particular land classes. I have been using the "distance" function in Package 'raster' in R to calculate the distance from ...
4
votes
0answers
39 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
4
votes
0answers
73 views

Which statistical methods to compare the spatial distribution of two different variables in two raster maps?

I am working with two global raster maps using the R Software (original file: netCDF for map 1 and GeoTIFF for map 2), with a resolution of 5 min of arc. Map 1 contains data on the share of the land ...
2
votes
1answer
48 views

How to use latitude/longitude with projection in R [duplicate]

I am using the SABS dataset: http://nces.ed.gov/surveys/sdds/sabs/ In particular, let's say I am using the "SABS_1314_High" layer. (This provides the school attendance boundaries for many US school ...
2
votes
2answers
56 views

R use data in SpatialGrid to create SpatialPoints

I am trying to make a grid of points to overlay on a raster of vegetation of Kansas, U.S.A. My idea is to use the points as a sort of centroid for the raster pixels, which are 30m resolution. When I ...
4
votes
1answer
118 views

Interpolate temperature data (shapefile) using R

The answer below solved my fist question, so I edit my question as follows: I have a shapefile given with the attributes lat, lon, elevation and temperature. So far I have a script that interpolates ...
1
vote
1answer
35 views

How to update selected rows of spatial data frame in R

I have a SpatialPointsDataFrame read via rgdal::readOGR require(rgdal) my_sp_layer <- readOGR(dsn="my_dsn", layer="my_layer_file") # select rows using col_attrib column ...
3
votes
0answers
71 views

MODIS R Package: GDAL Not Available

I am trying to analyze the MODIS EVI 250m, 16day dataset. I found the R MODIS package and am following the instructions here: ...
3
votes
1answer
52 views

Rotating ~90° using Two-Point Equidistant projection with Proj4

I'm trying to rotate a tif raster in R using Proj4's Two-Point Equidistant projection - I think the only way to rotate spatial geometries to custom angles. But I'm finding the operation gets very ...
0
votes
0answers
12 views

TimeDimension in R, leaflet [duplicate]

it's possible to do this this with R,leaflet ? any suggestion please?
2
votes
2answers
49 views

Create a new GRASS database in R with CRS projection

How to create a new GRASS database in R with CRS projection? I am able to create a new one using the following code but it is not projected require(raster) require(spgrass6) ...
4
votes
1answer
31 views

Remove certain polygon from SpatialPolygonDataFrame

I am using R maptools library to parse the shapefile into a list of polygons. The function readShapeSpatial shp <- readShapeSpatial("<path to my shapefile>") gives me a ...
1
vote
0answers
107 views

Convert PLSS (Section, Township, Range, Meridian) to Latitude and Longitude using R package or Python

I have data in the form of Section, Township, Range and meridian. I have 300,000 data points from all over the USA. Is there any way i can write R or python scripts to batch convert all the points to ...
0
votes
1answer
49 views

Adding shapes and/or icons to legend using Leaflet within R?

Is it possible, using Leaflet within R, to make a legend in such way that includes a set of icons or shapes and their corresponding value?
0
votes
0answers
54 views

Reprojecting a raster file in R

Help! I have a number of rasters from different sources with different projections. I want to reproject the rasters into a common projection (Eckert IV), somehow line the grids up, and then overlay ...
2
votes
0answers
44 views

Extract values from Rasters in R based on spatial points and spatial polygons

I am trying to extract values from a raster file using the extract command in R mentioned here: http://www.inside-r.org/packages/cran/raster/docs/extract My raster file is unprojected (WGS84 ...
1
vote
0answers
19 views

Subdistrics border change over time

I have 4 shapefiles of India state from 4 decades, and I trying to identify changes within the sub-district level such as splits or merge of sub-dist, border changes etc. I am using R but I can use ...
0
votes
0answers
42 views

Elevation profile of river in R

I would like to plot the elevation profile of a river (shapefile, single line) in R. How do I extract the elevation values (from a DEM .tif, for example) for the river line. I tried clipping but that ...
1
vote
1answer
177 views

Is it possible to use Leaflet.draw on a map in R?

I want to develop an application where a user can draw a line, polygon etc... I currently develop with R and leaflet package and I found that it is possible to work with Leaflet.draw under ...
0
votes
2answers
42 views

SpatialPointsDataFrame too slow FOR LOOP

I've run into a small problem where my for loop has been running for 3.5 hrs+. I have a Geodataset in SQL Server with a field called Shape that stores co-ordinates in geometry data type. Firstly, I ...
0
votes
1answer
58 views

Read SQL Server Geometry datatype in R

I have two datasets that come from ArcGis, stored in SQL Server. I have a column called - Shape which is a geometry data type and the value looks like this: ...
1
vote
2answers
87 views

What is the proj4string of the Lambert azimuthal equal-area projection?

Shapefiles of European data are available on the Eurostat website. I have loaded the NUTS_2013_60M_SH Shapefile in R with the command; europeRG <- readOGR(dsn = patheurope, layer = ...
3
votes
2answers
56 views

What is the epsg code of eurostat maps?

Shape files of Europe maps are available on the Eurostat website. I downloaded NUTS_2013_60M_SH. The tool (readOGR from the R package Rgdal) I use to load the map shows the following proj4string: ...
0
votes
1answer
25 views

Grass r.gwr addon difficulties Ubuntu

I am using Grass7 and Ubuntu14.4 I am attempting to carry out a geographically weighted regression between two .tif files but am having issues with the call to r.gwr Code and output is as follows. ...
1
vote
1answer
36 views

Matching Decedal Average NDVI and Worldclim Data

Ive never used NDVI (or EVI) datasets in R. Does anyone have any resource I could use to access a decadal average NDVI dataset for the globe. It would be preferable if this dataset was also comparable ...
1
vote
1answer
28 views

transformations from a sphere using R for raster and polygon data [duplicate]

I am planning on using the MODIS burned area products which were produced by Maryland University. These come as either polygons or rasters. In the user guide it says A shapefile version of the MCD45 ...
2
votes
0answers
29 views

Converting u and v from WGS84 to NZTM2000 - Do I need to do vector conversion?

I have u and v wind component values in latitude and longitude in WGS84. I want to convert this to NZTM2000. I've converted the lat/lon in ArcView - (and will try in R) - but do I need to also do some ...
0
votes
1answer
47 views

Map editor R & leaflet?

That is possible on a web map designed by R & leaflet give the opportunity to the user to draw lines, polygons, choose the colors (like a map editor)? if yes what's the package that allows me to ...
3
votes
3answers
129 views

Get rivers from a DEM raster

I am new to spatial analysis and even newer to hydrology. I have a 30arc DEM elevation raster and I was wondering if I can use it as an input to get the approximate presence of rivers in a ...
1
vote
1answer
43 views

Is it possible to map a leaflet provider (precipitation) on top of a polygon in an interactive map?

I've just started using the leaflet package in R to create interactive maps and I'm wondering if it's possible to plot one of the leaflet providers on top of a plotted polygon rather than under it as ...
1
vote
1answer
62 views

Wanting extract to produce sensible answers for NAs in R

So, I'm working on extracting values from multiple different rasters in R. However, some of our data is marine, some terrestrial. Some rasters cover both, but a few are ocean only or land only. At ...
1
vote
0answers
31 views

Problem in Variogram Plot [closed]

I tried to plot Variogram by this code from gstat packages: v <- variogram(log(zinc) ~ 1, meuse) plot(v) and here is the output: But I want to add line to point (draw variogram line). How I ...
1
vote
2answers
49 views

Automatically convert from latlon to planar

I work with library(sp) and points in latitude longitude, with this projection: proj4string(pts) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84") But some functions (such as sp::spample) ...
5
votes
1answer
84 views

Categorising Point Clusters

I have a point dataset of solar farm locations. The points are grouped according to which substation they feed into (see below). I would like to test the hypothesis that electrical output ...
1
vote
0answers
65 views

R code to find the smallest bounding box with arbitrary orientation

How can I devise an R-code that can derive a rectangular bounding box (with 90-degree angle on each corner) for a set of points with arbitrary orientation? e.g. if the 2 longer edges have a 45-degree ...
0
votes
0answers
17 views

Extracting coordinates and climatic conditions of grids where species polygon overlaps with the climatic layer in R?

I have species’ shapefiles and climatic raster files. The climatic file is in 50 * 50 km equal area grid. Now, I want to calculate the climatic conditions in each grid cell where species polygon ...
0
votes
1answer
101 views

Convert xy spatial points into spatial lines

I have produced a SpatialPoints object (named v3) in R from the function gIntersection (package rgeos). The SpatialPoints object v3 has the following structure and is represented by red points on the ...
0
votes
0answers
51 views

Downloading NOAA AVHRR NDVI using R

I am using the gimms package to automatically download NDVI data from 1981-2013. The code is provided here. The data is available here. However, after running it shows that data has been downloaded ...
1
vote
0answers
39 views

Correcting for offset

I have a shape file with RTK measurements as a line feature, which more or less corresponds with visible features in a raster layer (shaped as lines). These measurements however are not accurate ...
0
votes
1answer
34 views

How to create SpatialPixelsDataFrame from Latitude and Longitude data?

I have a data frame that contains latitude and longitude data with density point. I want to do kriging but my main problem is that I can not create SpatialPixelsDataFrame from my data. My data is ...
3
votes
2answers
57 views

How to remove points which are out of shapefile (or raster) extent

My problem is quite simple. I have thousands of points (coordinates) to analyse, however some of them are so inaccurate that they "hit" the sea. I need to get rid of them. I was trying to find some R ...