Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
0answers
24 views

Error mapping data frame in R: is.data.frame(map) is not TRUE

I am trying to generate a map using the following data and code: fileURL <- c("https://drive.google.com/open?id=0B-jAX5hT2D3hNnVtLVhROENKRGs") require(data.table) require(tidyr) require(dplyr) ...
2
votes
0answers
14 views

What is a UK boundary shapefile available for download via persistent URL (for cURL) with parish-level detail?

I'm in the process of generating a series of choropleth maps for a journal article and am writing this up in R as an .Rmd. My aim is to set this up as reproducible research, that is in a form which ...
0
votes
0answers
19 views

Making grid from CSV in R?

I tried since several weeks to make a grid with R from AFE data and assign occurrences of my species I have in separate folder with the cell names. Grid data under csv utm_new lon lat xpos ...
1
vote
0answers
10 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
1answer
55 views

R kriging in QGIS

I'm trying to work with the R Kriging script in QGIS (processing toolbox). I have installed R before directly to C:. I also have installed the packages raster, rgdal, sp and automap. When I'm starting ...
0
votes
0answers
16 views

Extract raster values from RASTERSBRICK using XY coordinates falling within each polygon R

I have a rasterbrick s (10000 raster layers) that actually is a time series raster. Accompanying s is a SpatialPolygonsDataFrame with many sub-polygons which can be identified by names and/or IDs etc. ...
1
vote
1answer
104 views

Programs/ languages to process netcdf files “fast”

I am using R to loop through thousands of NetCDF files (downscaled climate data), and while I am able to do it using R, the code is too slow. I am looking for a way to speed it up and to maintain ...
1
vote
2answers
740 views

How to create a time series with a NetCDF raster from Ensembles E-OBS using GDAL, R, GRASS GIS or SAGA GIS

I downloaded a NetCDF file that contains daily precipitation values from 1-1-1950 to 30-6-2013. The raster has 23191 bands. http://eca.knmi.nl/download/ensembles/download.php My goal is to analyze ...
7
votes
4answers
9k views

Converting osm file to shapefile (or data frame) in R

I was looking for a road shapefile for Australia today. I ended up going to Geofabrik. Open Street Map has data in .osm format. But they do not have one in .shp for Australia. If possible, I want to ...
3
votes
1answer
28 views

Is it possible to start the GRASS GUI from R?

I am using the rgrass7 package in R in order to work with GRASS GIS. After having set the needed enviornment variables, I can now launch a GRASS session from R and and work on my GRASS data using ...
1
vote
1answer
28 views

Using 'sp' method to subset SpatialPointsDataFrame with SpatialPolygon returns error in parLapply()

I have numerous very large data sets of ship tracking data (Automated Information System; AIS). These are originally in a file geodatabase and can be downloaded here (this is a smaller file for ...
0
votes
1answer
25 views

Get feature type of a layer

I have to assign the feature type of a layer. Does anyone know an function, or way to access this information. I have noticed that the message of the function readOGR (package rgdal) contains an ...
2
votes
0answers
39 views

Is there an R package for finding the maximum-area rectangle in a non-convex polygon?

Does anyone know if there is an R package out there with an algorithm which finds the largest rectangle within non-convex polygons? I have Googled, searched the R Sig Geo archives, and looked here on ...
-3
votes
0answers
10 views

How R read and get data from PostGis tables? [duplicate]

I have not more details to add, I need to receive a reply to question above if it is possible
2
votes
0answers
17 views

Path Matching for Journeys Using XY Coordinates [closed]

I am trying to find some suggestions on ways or algorithms to determine path similarity. An illustration of 3 paths using made up data is given below. The title should be finding similar paths instead ...
0
votes
1answer
21 views

histogram of raster coordinates in R

I'm trying to generate an histogram of the y coordinates where raster values are 1. Mysteriously the following, different rasters, give me the same histogram. What could I be doing wrong? here are ...
0
votes
1answer
80 views

Creating polygonal windows for spatial analysis in r

I am attempting to normalize a spatial point pattern using a population density raster in r. My problem is that the function I am trying to run is recognizing the "white space" around the raster I am ...
28
votes
4answers
35k views

How to open a Shapefile in R?

I need to open a shape file from ArcMap in R to use it for further geostatical analysis. I've converted it into ASCII text file, but in R it is recognized as data.frame. Coordinates function doesn't ...
1
vote
0answers
25 views

Clipping raster brick object in R

I have MODIS NDVI TIFF files for a year I want to first clip it with a irregular polygon (not by its extent only) of my study area and save it as a multi band raster in TIFF format The TIFF image are ...
7
votes
3answers
3k views

r - increase speed of crop, mask, & extract raster by many polygons

I'm extracting the area and percent cover of different land use types from a raster based on several thousand polygon boundaries. I've found that the extract function works much faster if I iterate ...
3
votes
3answers
91 views

Converting SpatialLinesDataFrame to SpatialPointsDataFrame in R?

In R I have a SpatialLinesDataFrame (for example from a coastline shapefile) and I want to convert it to a SpatialPointsDataFrame. I want to keep all the vertices from the line shapefile to become ...
1
vote
1answer
31 views

How do I get rid of edge effects while using focal in R to smooth a raster?

I am trying to use R with the focal function from the raster package to smooth raster images. I am working with Radar images that have already been preprocessed. As part of that, some calculations ...
2
votes
1answer
403 views

How to extract percentage of land cover from a raster according to multiple shapefiles?

I have a raster map that represents land cover of a region, and different shapefiles (total 120) in the same region. I want to know the percentage of every land cover for each shapefile. For example, ...
8
votes
2answers
2k views

Removing rows in shapefile in R

I've imported a shapefile into R, and joined it to a table. My shapefile contains all the census ids, while my table only contains selected census ids. I'm now trying delete all the rows didn't get a ...
0
votes
0answers
17 views

Add information from a raster nc-file to a polygon shapefile

DATA Download from this website the following ZIP file: NUTS_2006_60M_SH.zip and save all the NUTS_RG_60M_2006 files. In what follows I refer to this as "NUTS3 regions". Download from this website ...
3
votes
2answers
60 views

How to generate a buffer outside polygons having a given pixel value?

For example, I would like to build a 20-m buffer (represented in yellow in the image below) outside polygons having a value of 2 (represented in green) and to assign the value of 3 to buffer cells. ...
1
vote
1answer
26 views

Deciphering coord. ref. in R – very basic question

I'm trying to make sense of the coord. ref. parameters for rasters in R. For example, for a given raster, crs() gives the following: +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 ...
1
vote
2answers
26 views

How to overlay a polyshape to faceted maps in r with ggplot?

So i am quite new to the use of r and ggplot to produce high quality output maps for publications. I have managed to create a faceted map from my data following the approach proposed here ...
0
votes
0answers
42 views

collocated cokriging with gstat in R

I am trying to perform cokriging with temperature as the target variable and elevation as a secondary variable. Elevation (the secondary variable) is collocated with temperature (the target variable) ...
0
votes
0answers
16 views

Using the extract function in raster package for R with polygons

I have a shape file that contains some polygons and an unprojected raster. I'd like to extract the cells within the polygons using R, so I use code like this: # Load my polygons MyPoly <- ...
0
votes
1answer
24 views

Tabulate intersect in R

I would like to get the areas related to the polygons resulting from the intersection between two SpatialPolygonsDataFrames: 'A' and 'B'. SpatialPolygonsDataFrame 'B' has 3 different 'classes', which ...
1
vote
1answer
57 views

Leaflet output is grey

I would like to implement leaflet in shiny with R. I try to go with the simple examples I found online: library(leaflet) library(ggmap) somePlace <- ggmap::geocode("Vienna") # Information from ...
3
votes
1answer
33 views

Problem with automated data storing during raster::crop (‘legend’ is not a slot in class “RasterStack”)

I am working with a set of raster layers containing CHIRPS monthly rainfall amounts over Africa. For purposes of reproducing the below code, I staged the decompressed tif files on Dropbox. Now, ...
0
votes
0answers
23 views

Estimating Daily average temperature from 2021-2050 in R

For my study I am dealing with daily temperature modeled data from 2021 to 2050. My data is in ncdf format. I want to calculate the average daily temperature across this period i.e the result should ...
1
vote
1answer
50 views

Find NoData values inside a polygon area from a raster

I have a raster (representing a polygon in black) which contains NA values (represented by white pixels) that are located inside the polygon and outside the polygon. How can I get the index value ...
0
votes
1answer
25 views

Converting data from data frame into raster file using R?

I have the following data frame (long, lat, value) (all coordinates are within Colombia): Spoints: x y z 1 -75.67083 7.57916667 7.328901e-19 2 -74.59583 ...
1
vote
1answer
27 views

Finding and loading global population density raster data into R?

I am using the Bioclim dataset for a maxent project right now, but I want to add demographic predictors along with climatic ones. I have the 19 layer raster data from Bioclim and I'm hoping to use the ...
4
votes
1answer
64 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 ...
1
vote
0answers
49 views

Troubling using MODIS package in R (mac). Error with gdal

I'm new to using MODIS data, and have been trying to set up a a way to use the HDF files produced by MODIS on R. I had trouble with gdal (could only download the package through system dialog), and ...
0
votes
1answer
35 views

Crop Raster from using Polygon shapefile in R

I am trying to crop a raster by a polygon in R to the state of Sergipe-Brazil. My raster is a raster brick criated by 7 .tif files which are EVI (vegetation index) time series. Since the EVI archives ...
3
votes
1answer
66 views

Create polygons of the extents of a Raster in R

I want to create two polygons. One is of the rectangular extents of my raster. I know I can obtain the extent of the raster using r <- raster("band5.tif") e <- extent(r) but don't know how ...
1
vote
2answers
751 views

NA values in dbf when exporting shapefile from R with writeOGR?

I´m writing an esri shapefile from R (2.14.1) on windows, using writeOGR in the rgdal package, in the resulting dbf file, NA values in the spatialpointdataframe (in numeric columns) are not translated ...
0
votes
1answer
167 views

Plotting an eia shapefile in google maps with R?

I'm trying to plot a eia shapefile onto google maps. I have a code working with the map funciton but can't get it to work with the ggmap function. Where am I going wrong? Working code: ...
0
votes
0answers
20 views

Find Maximum value per month in rasterstack/brick and corresponding timestamp R

When dealing with raster images, I found the raster and rts packages in R to be very flexible for analysing my raster data unlike ArcGIS. In my learning efforts, I have had to do some ...
2
votes
0answers
36 views

Differences in MaxEnt between 'Biomod2' and 'Dismo' package

I am trying to run an ensemble species distribution, however the the results I am getting for MAXENT.Phillips model are not reasonable projections compared to the Random Forest and Boosted Regression ...
2
votes
1answer
30 views

Error writeOGR using R

I am learning how to use writeOGR to write a GPX file. When I run the line of code I get an error message: Creation of output file failed. Example set of data dput(head(location_information)) ...
0
votes
0answers
16 views

Filtering points on a map based on user selection in R

I am trying to put about 5000 points on a map. I achieved this using leaflet and shiny but I am trying to group the data by departments. I want to be able to select only one department in the dataset ...
3
votes
1answer
47 views

extract() function from r raster package returns different cells if “weights” parameter is TRUE or FALSE

I am trying to extract cell values from a RasterLayer based on a SpatialPolygons object. I create the raster with library(raster) rasterValues <- matrix(rnorm(20),4,5) r <- ...
0
votes
1answer
36 views

Find Lat and Long points on land only

I'm new to R and GIS so please forgive me if this is a simple request. I was looking for a way to find out if a Lat/Long point is on land or ocean. I found this previous post from a couple of years ...
0
votes
1answer
201 views

using raster.predict for Cubist model, factor levels list

I would like to thank in advance any help or advice. Let me know if I need to provide more reproducible data/code. I am working on a Cubist prediction model for soil texture, using continuous and ...