We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [r]

Statistical computing language and software environment.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k 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
815 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
983 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
53 views

How to join CSV data (based on admin boundary names) to shapefile of aforementioned boundaries in R? [duplicate]

DATA: CSV data, Shapefile Hi all! I'm looking to perform what I've been taught is called a spatial join. After researching this further, it's looking like this operation is most often called a ...
0
votes
1answer
111 views

Exporting “pennLC” object stored in R as a shapefile

I need to export the pennLC object from package:SpatialEpi as a shapefile. pennLC contains different components of lung cancer dataset for Pennsylvania state such as: $geo, a data frame $data, a ...
0
votes
1answer
265 views

How to extracting values of 40 plots from different bands of raster image in R?

I have 40 plots(samples) and I want to extract corresponding values from different bands of RapidEye image. So at the end I want to have totally 200 values of 5 bands in the format of txt. Till now I ...
0
votes
0answers
152 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
145 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
88 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
2answers
858 views

Getting time-zones from latitude and longitude in raster using R?

I have a raster with longitudes and latitudes for the US with meteorological data (for about 100k grid points). I would like to get the time zone for each point in order to transform the time to local ...
0
votes
1answer
174 views

Multiple Subsetting [closed]

Input File, XY min,max file I have a XYZ .csv file for a large portion of an area. I have another txt file which contains Box numbers, Xmin, Ymin, Xmax, Ymax. I would like to export a CSV file for ...
0
votes
2answers
251 views

PostGIS raster write support in R

I want to push/write some generated raster layers to my postgres database directly in R. In theory this could be supported by the rgdal package, but sadly it isn't. In the latest version only copy, ...
0
votes
0answers
329 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
55 views

Calculating mean and standard deviation for raster values using whole pixels within a polygon [duplicate]

I have a raster image and a corresponding shapefile. I would like to calculate the statistics of the values within polygons which have a common attribute but only using pixels which are fully ...
0
votes
0answers
140 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
191 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 ...
0
votes
1answer
87 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
1answer
107 views

Updating R version in R-ArcGIS/r-bridge?

I recently installed the R-ArcGIS bridge, following the steps on the associated github. I have ArcGIS 10.3, along with both R 3.2 & R 3.3 installed. It is only recognizing the R v3.2 installation, ...
-1
votes
2answers
776 views

Aggregation of MODIS 16 days data to annual data set

Is there a way to calculate mean annual NDVI and mean annual EVI from the time series MODIS images (2000 - 2016). I have gridded data downloaded to the local drive. Planning to use R for this work.
-1
votes
1answer
1k views

conversion of .img to binary file using R

I have a series of raster images which have to be converted to binary files. I request you to suggest a R code for conversion of all files at a time
-1
votes
1answer
78 views

Points don't show up on an overlaying shapefile?

library(ggmap) library(rgdal) cities<-c("city A","city B") country<-readOGR(dsn=".",layer="country") gc<-geocode(cities,source="google") gc$names<-c("city A","city B") coordinates(gc)<-...
-1
votes
1answer
1k views

Single point in R

My question might be very simple. I want to create a single point (with xy coordinates) in a specific region, in a specific position. I don't want to do that with qgis I want to do that in R. Is there ...
-1
votes
2answers
438 views

Order list of rasters R [closed]

I have some raster files which names are Band_2..., Band_3... etc. I want to order them from the minimum number (2) to the maximum (12). Here is the code I am using S2_masked<-"/2_1_R_Processed/...
-1
votes
2answers
306 views

Re-sample raster to acre grid using ArcGIS Desktop or R? [closed]

I have a 1m classified landcover raster layer that consists of values 1-4 representing various land covers. I need to resample this layer to an acre grid. Each acre in the resultant grid should ...
-1
votes
1answer
71 views

Calculating pairwise Spearman's correlation coefficients for multiple raster layers in R [closed]

I have six raster datasets with matching resolution and extent. I want to analyze the relation between those rasters by calculating pairwise Spearman's correlation coefficients for all combinations ...
-1
votes
1answer
32 views

Which R package has basic map data of Europe embedded?

Where can I find open source map data for countries in Europe? I need geographical data such as borders, rivers,elevation and I need also statistical data (population, etc.) Is there by chance an ...
-1
votes
1answer
726 views

changing projection in R without changing resolution [closed]

I have the following code to re-project my raster data. My problem is that when I change the projection, it seems that the resolution as well as pixel values change. I want to maintain the original ...
-1
votes
1answer
2k views

Select pixel values in a raster using R

I'm trying to select some cell values in a raster MODIS. Follow my problem: I have to filter these values to mask after it: 32767,32766,32765,32764,32763,32762,32761 I've used this code to one value:...
-1
votes
1answer
458 views

get_googlemaps returning map with warped longitude/latitude in R?

I'm trying to retrieve a tile of Downtown Los Angeles from Google Maps using ggmap and ggplot2, specifically the function get_googlemaps, and then I want to overlay a shapefile over it displaying the ...
-1
votes
1answer
1k views

Select polygons (A) that contain polygons (B) by using R code

I am wondering how to select polygons (A) that contain polygons (B) by using R code. B<-readOGR(dsn="H:/AP", layer="WWTP") A<-readOGR(dsn="H:/AP", layer="catchment")
-1
votes
1answer
1k views

How to read metadata file in R [closed]

How to read metadata file parameters( like sun elevation,REFLECTANCE_MULT_BAND etc ) from R How can end user validate the parameter of metadat file(.mtl)? How can I pass specified parameter of the ....
-1
votes
1answer
43 views

How to convert missing values to the mean of the other values in R? [closed]

I need to convert the missing values of a column in a dataframe with the rest of values of this column, grouped by Districts and Month. This is a sample of my df1: Date Day Month Year ...
-1
votes
1answer
54 views

Using R to extract data from Global Aridity Index and Potential Evapotranspiration (ET0) Climate Database v2? [closed]

I have a latitude/longitude dataset; I wish to extract the aridity index for each of location in R. I am new to R, so I seek basic code along with the required libraries.
-1
votes
1answer
58 views

Extracting data from ASCII file? [closed]

I have ASCII files for a country that map altitude. I'd like to extract information on slopes for specific cities in my country. My goal is to have at least a rough idea of physical constraints in ...
-1
votes
1answer
305 views

Reorder legend in ggplot object [closed]

I met some trouble when dealing with the order of ggplot legend. I plotted three lines in one graph, and I tried to use 'scale_colour_mannual' to change the order as the line from top to bottom, but ...
-1
votes
1answer
57 views

Creating isometric “stack” of raster bands using R?

Is it possible to create an image like this one by using R? The image is taken from UseR! 2019 Spatial workshop part I.
-1
votes
1answer
35 views

Calculating new raster metrics without polygonizing in R?

I have an enormous number of large rasters representing tree canopies. Every individual canopy has a unique number that is assigned to each pixel that is part of the tree. I am working with R and the ...
-1
votes
1answer
59 views

Default parameter values in r's gstat idw?

In r, gstat has an Inverse distance weighted (IDW) interpolation method. Does anyone know what the default values of nmin, nmax and maxdist are?
-1
votes
1answer
78 views

Dealing with Islands with sf objects and the tmap package [closed]

I have the bounderies for the municipalities in the "capital region" of Denmark. The acctual map looks like this: The yellow island is the fourth row in my sf object. I am trying to folllow the ...
-1
votes
1answer
104 views

How can I use rts function for time series TIFF using R

I am trying to plot a time series for my TIFF stack MODIS EVI with the rts function. I am trying to use this script but I do not know if I can use it for my TIFF stack. path <- system.file("D:/...
-1
votes
1answer
114 views

Error in .getModisList(x = xx, h = h, v = v, dates = dates, opt = opt, : No available data for the selected dates

I have a problem using ModisDownload from RTS Package on R, i always have the same error using ModisDownload or getMODIS functions : Error in .getModisList(x = xx, h = h, v = v, dates = dates, opt = ...
-1
votes
1answer
456 views

Performing Cokriging in R? [closed]

I would like to perform cokriging of 60 observed data points. In the shapefile, there are 60 fields containing the observations as Time 1 to Time 60. I also have 60 rasters in tiff format. I want to ...
-1
votes
1answer
99 views

Download point files from Census On the Map in R

I'd like to automate downloading point shapefile data from Census OnTheMap. There is a link which can be used to download the data, as provided below: https://onthemap.ces.census.gov/cgi-bin/report....
-1
votes
1answer
161 views

Predicting Enhanced Vegetation Index using Random Forest in R [closed]

I am a master's student and I am trying to use radar observables derived from SAR imagery to predict Landsat 8 Enhanced Vegetation Index (EVI) for different seasons. I have extracted EVI and various ...
-1
votes
1answer
68 views

Formally assessing in R if set of points tends to cluster around some of points of another set? [closed]

Some years ago, I asked how it is possible to formally assess the spatial relation between two sets of points, for instance if a building type A tends to occur close to building type B. The answer I ...
-1
votes
1answer
566 views

How to open multiple Globcolour netCDF files and extract the data into a dataframe in R?

I ordered netCDF chlorophyll data from 2002 to 2010 of the Caspian Sea region from http://hermes.acri.fr. Then, I got 726 .nc files listed in a folder and downloaded them from the FTP site. So now I ...
-1
votes
1answer
571 views

Format difference between list of dates and specified date in R? [closed]

I want to determine the number of days between each of a list of dates and a specified date - here 1987-01-01. Looking at other examples and using some example data I write: Example<-as.Date(c("...
-1
votes
0answers
19 views

Is it possible to query a geopackage (.gpkg) for features within a given bounding box?

I have GIS data with a very large layer stored within a geopackage from where I want to select features that fall within a bounding box calculated in my R session. I begin by creating a query string: ...
-1
votes
0answers
22 views

Using R to call real-time weather data with issued API key

I would like to use the following API website: Weatherstack (https://weatherstack.com/) to retrieve real-time weather-related information. I am using a free subscription which allows the user to make ...
-1
votes
2answers
19 views

R Remove upper and lower percentile from SpatialLines (DataFrame) [closed]

How can I make a selection depending on the statistics of a SpatialLinesDataFrame in R? The goal is to select and subset the lower and upper quartile of a data frame at once.