Statistical computing language and software environment.

learn more… | top users | synonyms

0
votes
1answer
28 views

Calculating the number of days above freezing in R

Im wondering if anyone has come across any data source that can be used to calculate the number of days where temperatures are greater than 0 degrees C, 10 C and 20 C at a global scale? I have a site ...
3
votes
2answers
121 views

Plot tilted map in R

I would like to plot a tilted map, similar to the image below. I would prefer to do this using ggplot2 but I'm glad if there is a solution using base R. Any ideas on how to do this? Here is a dataset ...
3
votes
1answer
32 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 ...
2
votes
0answers
21 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
28 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
38 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
43 views

Use of Leaflet plugins in 'Leaflet for R' to connect with ArcGIS online

I was wondering if it is possible to use the plugins for the normal (non-R) version of Leaflet, and if, how I can do that. reason I need to do that is, that some of the data I need to show are hosted ...
1
vote
0answers
40 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 ...
0
votes
0answers
24 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 ...
1
vote
1answer
30 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 ...
0
votes
0answers
63 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
23 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 <- ...
3
votes
2answers
69 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
2answers
32 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
1answer
34 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 ...
0
votes
0answers
28 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
67 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
35 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
2answers
89 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 ...
1
vote
0answers
64 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 ...
1
vote
1answer
37 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 ...
0
votes
1answer
47 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
89 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 ...
0
votes
0answers
28 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
1answer
34 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
3answers
68 views

Converting position data created in R to GPX format?

Does anyone know if there is a way to convert position data (latitude and longitude) created in R to GPX format to use with navigation software? I have been searching and havent found an answer. ...
1
vote
1answer
37 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 ...
3
votes
1answer
58 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 <- ...
2
votes
0answers
66 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 ...
0
votes
0answers
36 views

Changing/ updating dimension values of ncdf file in r

I posted this question to SO but in hindsight, gis.se is a much more suitable place: I have several ncdf files that do not have the correct spatial dimension values so I want to update these values. ...
0
votes
1answer
37 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 ...
2
votes
0answers
43 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 ...
0
votes
0answers
42 views

How to clip MrSID Files in R and export to GeoTiff?

I would like to use R to: Read in an MrSID raster (.sid format) Clip the extent using a shapefile Save the new clipped raster as a geotiff I am fine with steps #2 and 3, but I can't find any ...
0
votes
1answer
46 views

Downloading MODIS data of cloud cover less than 10%

I use ModisDownload from rts package for downloading MODIS data. But is it possible to specify cloud cover and view angle before downloading? e.g. if I want to download MODIS data for cloud cover less ...
0
votes
0answers
67 views

Convert raster stack to RGB GeoTIFF for use as a background image in maps (in R)

I've been trying to use R to download google maps images as rasters, then convert them into GeoTIFF files which can be imported as a geo-referenced background layer in GIS programs. I've been ...
2
votes
0answers
41 views

How to clip a .osm.pbf file to a shapefile in R

I have (1) an OpenStreetMap file of a large area in .osm.pbf format that I would like to clip with (2) a shape file .shp of a smaller area using R. The output output I would like to get is a ...
1
vote
1answer
41 views

How can I plot points with proportional circles, but also by colour from another attribute? [duplicate]

I have point data of population density that I have plotted to show density with proportional circle symbols. This is straightforward with many ways of achieving this in different software and ...
0
votes
1answer
61 views

Change the values of NA cells in a raster by using a geographic subset of the raster as a condition

I would like to replace the NA cells that are within a specified extent (here rectangular area defined by drawExtent in the code bellow) of a raster object. My idea was to use the functions ...
0
votes
2answers
50 views

Create shapefile connecting points “as the crow flies” in R

I have a set of locations (with latitude and longitude). I know how to get the distance between these points, but I want to create a line that connects them with the shortest path ("as the crow ...
0
votes
0answers
27 views

Link between arcgis and R

I am modelling vector abundance using R-INLA package. Next I need to made a map of vector distribution and I use ArcGIS, raster calculator tool. Is there any form to link R and ArcGIS for this ...
2
votes
1answer
33 views

GIS Least Cost Spanning Tree in R

Is there an R package/function that computes a least cost spanning tree given a shapefile or vector containing the latitude/longitude of each point and a raster file that contains the cost of ...
1
vote
0answers
36 views

non-finite value supplied by optim when I use estiStAni or fit.StVariogram

I have computed an empirical spatio-temporal variogram and I want to fit it into a model I built using vgmST. However, whenever I call fit.StVariogram I get the error "non-finite value supplied by ...
0
votes
0answers
14 views

glcm texture in R (mean_Envi)

I am running a Image texture measures from grey-level co-occurrence matrices (GLCM) using the glcm package in R and I would like to know what is the difference between mean' and 'mean_ENVI' / ...
0
votes
2answers
72 views

Remove lines from inside a polygon (shapefile) in r

I have this code which prints the Galápagos Islands. But inside the islands, there are lines that I want to get rid off. How is this possible in R? library(rgdal) library(ggplot2) URL <- ...
2
votes
1answer
44 views

ArcMAP / R: Convert raster pixels to Long and Lat

I have downloaded a raster, which has the following information. Item Data Date 2015-01-03 00:00:00 Product cold partial sst Satellite NOAA-18 Direction Unknown Dimension 1596 x 1617 BPP ...
1
vote
2answers
51 views

Transformation from EPSG 31983 to EPSG 4326 change only one axis (R + ggmap)

I'm trying to convert my shape file with spTransform(), but it's not successful. I don't know why it's changing only one axis. I want to change the axis into decimal degree. # Libraries ...
3
votes
3answers
126 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 ...
0
votes
0answers
76 views

Changing the cell size and projection of a raster to correspond with the ones of another raster

I have two rasters with different resolution and projection. > r1 class : RasterLayer dimensions : 2510, 5233, 13134830 (nrow, ncol, ncell) resolution : 56, 56 (x, y) extent : ...
2
votes
1answer
45 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 ...