Questions tagged [r]

Statistical computing language and software environment.

944 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
633 views

Plotting and/or exporting VIIRS SDR DNB data as GeoTIFF in R?

I already asked this question @stackoverflow however, perhaps it fits better here, due to the spatial nature of VIIRS data and the hdf5-eos file format. Im looking into how to handle .h5 (hdf-eos) ...
0
votes
0answers
400 views

Raster Time Series, express years in time series

What's the best option to express years in Raster Time Series object in R. I define years as dates: YEARSSEQ <-seq(as.Date("2008-01-01"), as.Date("2009-01-01"), "year") and then I pass them in ...
0
votes
0answers
55 views

Extent of shp files with R for overlapping

I have 2 shapefiles: data (spatial point dataframe) and polys (polygons dataframe). I want to do an overlap but is seems that it does not work. Here are data and polys: > data class : ...
0
votes
0answers
48 views

Preparing two raster datasets for grouped barplot

I have two overlying raster datasets in ArcGIS which do have the same extent. One is a digital elevation model and the other one is a raster mask that contains three landuse classes (see figure below)....
0
votes
0answers
175 views

Mapshaper running out of memory on R

I'm using rmapshaper, the R wrapper of MapShaper, to simplify polygons without slivers and it works well on small shapefiles. However, when I run it on a larger one (~150M, ~5000 shapes), it runs out ...
0
votes
0answers
171 views

Comparing feature values between spatial points (same locations and variables - different surveys)

How can one (statistically) compare the feature values of one set of points against the feature values of a different set of points (within the same spatial extent)? I am aware of methods of ...
0
votes
0answers
657 views

Is there a way to retrieve shapefile attribute table information for a given coordinate in R?

Does anyone have an idea how could one get information out of shapefile attribute table (class SpatialPolygonsDataFrame in R), in my case data from column that contains species names, based on a list ...
0
votes
1answer
387 views

Estimating kernel bandwidth function with cross-validation gwrr package?

I am relatively new to R. I am attempting to use the gwrr package because I suspect that local collinearity may be an issue in my geographic weighted regression model. If I am not mistaken, I first ...
0
votes
0answers
482 views

Plot RGB raster on basemap in R

I want to plot my RGB raster on a basemap in R. So far I have a RasterStack object and I have downloaded the basemap with ggmap. I can plot them individually but not together. stack_rrs <- stack(...
0
votes
0answers
253 views

Appropriate method for transforming log-transformed kriging predictions back to original scale (R)

I am attempting to run some interpolations using kriging on transformed data using the transformation log (x + 1) - because my non-negative data has many zero values. The problem I have is with back-...
0
votes
0answers
96 views

Reclass a landuse shapefile based on another shapefile using R

I have a landuse shapefile that I want to modify based on another shapefile. In this example I have three classes in landuse shapefile A. Say I'd know that everything within one of the small ...
0
votes
0answers
65 views

Map point class diversity on raster efficiently in R

I have a point data set of roughly 2'000 features that represent User GPS locations. I'd like to calculate the User diversity per pixel. This is a (very slow) Pseudocode: library(raster) library(sp) ...
0
votes
0answers
105 views

Copying coordinate system and extent from a TIFF to a polygon shapefile in SAGA GIS

I used R to batch process object based image segmentation on some geoTIFF files using rgdal to communicate with SAGA GIS. I got the resulting shapefiles, all with the following properties: Projection ...
0
votes
0answers
104 views

Combining postal codes into sales territories by value using R and ggplot2?

I have the shapefile for Canadian census subdivisions. For each subdivision I calculated some value (someValue). I want to combine census subdivisions into territories in such a way that territories ...
0
votes
0answers
377 views

Summarizing multiple raster values by polygon

I have seen several discussions about zonal statistics and similar processes for summarizing rasters by polygons, however I have a question that I can't seem to find an answer to. Most of these past ...
0
votes
0answers
392 views

is plotkml no longer updated for current R release?

I am attempting to use plotkml to read gpx files and plot them using R. Many others have done this with great success. A few examples are below: https://www.visualcinnamon.com/2014/03/running-paths-...
0
votes
0answers
80 views

May I change rgrass7 location in R script

I'm using Grass-GIS 7.2 in R with rgrass7. I would like to use rasters from 2 different location. Is there a way to do that without brutality ? At this time it works with : library(rgrass7) # ...
0
votes
0answers
783 views

How to write netcdf files with multiple variables?

I'm using raster stack objects and I want to use multiple stacks and write them in a single netcdf file. In case of one stack its straight forward as the below example, but how can I have both of the ...
0
votes
0answers
103 views

Cannot extract cell values after reprojecting raster in R?

I've downloaded an 8-day composite (4x4km) of "chlorophyll a" for May 1, 2014. https://oceancolor.gsfc.nasa.gov/cgi/l3?per=8D&prd=CHL_chlor_a.nc&sen=A&res=4km&num=24&ctg=Standard&...
0
votes
0answers
640 views

Extracting information from Esri Grid Format (ADF) file using R?

I have an adf file that has a variety of "attribute" or field layers, and I am trying to extract one layer from that adf file, and convert it to a tiff image for further processing in python. Here is ...
0
votes
0answers
213 views

R memory issue with large polygon grid file

I have a 1 km by 1 km grid polygons for all of Ontario, Canada. This file is roughly 1 GB with 1116965 rows and can downloaded here: https://www.ontario.ca/data/utm-universal-transverse-mercator-1-km-...
0
votes
0answers
39 views

Recode 1 raster conditionally, based on many others

the basic premise is that I have 1 chief raster with values 55 to 75 and 6 rasters (A to F) which have all sorts of values between 1 and 15. If the chief raster has values (e.g.) 50 to 55, those ...
0
votes
0answers
222 views

import SpatialPolygonsDataFrame (SPDF) into PostgreSQL DB schema from R

This is a followup question to Writeogr to PostgreSQL/PostGIS database with R How can I choose the schema where to put the SPDF (or any other spatial object)? postgis_insert(con, df=catchments, tbl=...
0
votes
0answers
390 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. ...
0
votes
1answer
2k views

Converting raster stack to RGB GeoTIFF for use as a background image in maps using 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 ...
0
votes
0answers
898 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 ...
0
votes
0answers
1k views

Extracting multiple values from list and storing them in data frame using R?

I have a list of 3 SpatialPolygonsDataFrames. Every element has a number which is the perimeter. I want through a loop to store the numbers into one cell of a data frame like: 154,526,442. I tried to ...
0
votes
0answers
161 views

Spatial segregation from a raster of racial distribution in the USA

I am trying to measure the degree of racial segregation at some geographic level (let's say the county level, for simplicity) in the USA. I have a shapefile with these geographic units. To do so, I'...
0
votes
0answers
168 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): downloader::download("http://...
0
votes
0answers
99 views

Rasterize and union problem

i've done the union first and then rasterized it. But now i want instead of that, to rasterize each one and then merge it as one. How do i do that? I mean without the union first off. on<-union(...
0
votes
0answers
355 views

Dates are off when opening netcdf file in R

I have a netcdf file with the time dimension that goes from 12/2007 until 12/2010 with monthly time steps. I can see the correct dates in both arcgis and panoply. Panoply tells me this file is a ...
0
votes
0answers
142 views

Why does a shapefile shift after transformation?

I have a shapefile created in the raster package (ER_14.3_2000_poly). > #read in a raster file > ER_14.3_2000<-raster('E:/Ecoregions Models/Outputs/ER_14.3/ER_14.3_ConsensusMap3.asc') > ...
0
votes
1answer
387 views

Performing trend analysis with R?

I have data of monthly temperature for 60 years. I want to analyze the trend for the monthly temperature in R. How do I construct R Code which would analyze monthly trend over the time series to ...
-1
votes
0answers
15 views

Combining two dataset (species distribution based on climate data) together using R

I want to merge a mean July Europe temperature dataset and emy_orb dataset together. Here is temperature dataset. Because it also includes other months and regions, I use codes to filter. library(...
-1
votes
0answers
33 views

Projection error while extracting the evaportranspiration data by R script from NetCDF file

I am using R script for extracting evapotranspiration data from GLEAM NetCDF file. After loading shapefile and NetCDF file, when I try to project both these file to same coordinate system and run the ...
-1
votes
1answer
73 views

Plotting Bar Charts on top of Maps in R

I am trying to place bar charts on top of a map of the United States. For whatever reason, I receive this error: > mapbars(x=x1, xllc=-110, yllc=40, barwidth=.5, maxheight=5) Error in mapbars(x = ...
-1
votes
1answer
58 views

Spatially join linestrings (which can overlap or not overlap) in R and provide output in a data format that I can add other variables

I am using R to exam road infrastructure. The sf dataset I am using is very granular e.g. for the same road two or three observations may exist that are differentiated by different coloured tarmac ...
-1
votes
1answer
48 views

Weird problem with st_polygon in the sf package

I would like to create a simple polygon using the sf package. From my understanding, I have to create a two column matrix where the last row is identical to the first one to close the ring of the ...
-1
votes
1answer
134 views

Converting Kelvin to Fahrenheit in raster stack using R?

I have a raster stack with 372 layers with Kelvin temperature. I want to convert Kelvin to Fahrenheit. I know the function, but do not know how to adjust the code so it can be applied to all layer in ...
-1
votes
1answer
408 views

Opening Esri Geodatabase file with GDAL/QGIS/Grass?

EDIT: I have a 64-bit installation of QGIS but 32-bit Microsoft Office Access drivers. It has been suggested that this is the cause of the problem, which is also indicated in this post: https://www....
-1
votes
1answer
303 views

gdal_translate in R changing the cell resolution of extracted subdataset from HDF

I'm trying to extract subdataset from MODIS LST HDFs using following code. library(gdalUtils) HDF_list = list.files(path, pattern= "\\.hdf$", all.files=FALSE, full.names=TRUE,recursive=FALSE) ...
-1
votes
2answers
871 views

Correlation between raster pixels within each polygon

I have two raster layers with the same extent, CRS, and resolution, and a shapefile consisting of a number of polygons. I would like to calculate the Pearson correlation between the two rasters within ...
-2
votes
0answers
32 views

Fonction de calcul de la longueur de calcul sous R [Calculation function of the calculation length under R]

Bonjour je voudrais avoir une idée comment faire une fonction sous R qui calcule la longueur d'une frontière partagée entre une division administrative (par exemple commune) et un pays voisin. Google ...
-3
votes
1answer
90 views

GRASS executable in Shell with R

I was trying to write a shell script using GRASS commands and I realized that I wanted to use R commands in my code but I couldn't find a way to execute the Rscript using my results from the GRASS ...

1
15 16 17 18
19