Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

Statistical computing language and software environment.

-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
366 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
298 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
454 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
1k 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
924 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
30 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
36 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
55 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
70 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
108 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
555 views

R: Error in checking point inside polygon

I am trying to check if location point is inside the polygon and it works for certain location point. But for certain location point output says point is outside polygon even if it is inside. Rmap &...
-1
votes
1answer
372 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
91 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
420 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
140 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
64 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
467 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
565 views

Update R in Ubuntu xenial [closed]

I am working in Ubuntu Xenial with R v 3.2.3. I am trying to updated to the last version of R since I need to install the rgdal package to work with raster data in RStudio but I can't manage. I have ...
-1
votes
1answer
487 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
20 views

Zipped shapefile upload, R Shiny [on hold]

I've created a feature to import a shapefile (via .dbf .prj .shp .shx) but I would prefer to import only a zipped shapefile. How will I be able to transform this function? Here's my code : server.R ...
-1
votes
1answer
33 views

The slot for “plotOrder” comes up as 1 instead of a vector with length specific to my data

My goal is to find neighbors from my SpatialPolygons object using the poly2nb() command from the sp package in R. This is my code thus far: p <- s_gis %>% select(long, lat) %>% ...
-2
votes
3answers
19k views

How to add a field to a shapefile using R [closed]

This question is trying to make sense of a post that already exists that looks good, but is failing in practice. The second ranked answer uses the foreign package to read a shapefile attribute table ...
-2
votes
1answer
178 views

Looping for NDVI in different file paths using R? [closed]

I have different bands separated in different file directory. I used Raster Calculator to calculate NDVI using "NIR1.tif"-"RED1.tif"/"NIR1.tif"+"RED1.tif" as formula. The link below describes a loop ...
-2
votes
1answer
75 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)<-...
-2
votes
1answer
105 views

shapefiles for New York City Airports [closed]

Where can I get shapefiles for New York City Airports? I want to check if certain latitude longitude points are within the airports, so if I have a shapefile, I can use R to check whether or not my ...
-2
votes
1answer
4k views

How can open a shapefile using R maptools package? [closed]

library(maptools) mn.map.shp = readShapeSpatial("minnesota.shp") Results this error at second line: Error in getinfo.shape(fn) : Error opening SHP file
-2
votes
1answer
94 views

Creating function in R that processes rasters in Esri grid format? [duplicate]

I have loads of data (6500 files that I need to process and find yearly winter sums/averages/variance for. the format for my naming system is Syyyymmdd_rp. Each file is in the same file folder. I ...
-2
votes
1answer
17 views

Loading multiband image using brick() fails?

Here's my working environment, R version 3.4.4/R Studio version 1.0.143, below is the line of code that fails : Image<- brick(ImageName.tiff) brings the error below : Error in .local(.Object, ......
-2
votes
1answer
62 views

How to use inverse distance to a power algorithm in R(not weighted)? [closed]

Can some one provide an example R code to replace the GRID (inverse distance to a power) interpolation algorithm in QGIS. I am looking for R code.
-2
votes
1answer
71 views

Dissimilarity and distance based clustering around outliers using R? [closed]

I have point data for healthcare facilities for a country - I want to first identify outlier facilities (that serve most no of patients) and then cluster nearby facilities that serve lower than ...
-2
votes
1answer
506 views

Rainfall raster with spline in R

I need to create a rainfall raster with cubic spline in R, but I don't know what to do.I have precipitation heights and coordinates of the point where they are measured. Can anyone help me?I tried ...
-2
votes
1answer
71 views

parsing variables from a Linux terminal in an R script [closed]

So I wanted to parse a variable with raster data to an R script. Now I found something like this (https://www.reddit.com/r/Rlanguage/comments/6p8a8q/r_shell_script/) but I don't really think it's ...
-2
votes
1answer
88 views

Error running a R Scripts in QGIS?

I have developed script in R but I am unable to run it in QGIS. It shows an error that R is not available even though it is installed in my laptop? What is the solution?
-2
votes
1answer
111 views

Point selection inside buffer

I'm working in a case-control study and I would like to ask if it's possible to create a 1km buffer for all cases and select only those ones which at least have one control inside the buffer.
-2
votes
1answer
352 views

R code for SDM using randomForest [closed]

I wonder if someone can provide me with R code for running Species Distribution model using randomForest where I can't find any tutorials or demos for this.
-2
votes
2answers
237 views

Geo spatial coordinates database inside the city boundary [closed]

I'm looking for geospatial data from: database, spreadsheet or anything else. My goal is to automatically point random location into a specific city (for instance Kyoto) on a 2D map with a view from ...
-2
votes
1answer
3k views

Using R calculating NDVI [duplicate]

Is there any function to calculate statistical NDVI in landsat8 package
-3
votes
1answer
760 views

Merging netcdf files into one using R?

I have hundreds of daily netcdf containing geographic lat/long and parameters. I want to merge them into one file. So the time will only vary. I downloaded NCO but it is not very friendly for window ...
-3
votes
1answer
270 views

How to colour a SpatialLinesDataFrame with Rainbow [closed]

how to color a SpatialLinesDataFrame according to some given value (Rainbow) FRA=readShapePoly("FRA_adm0.shp") grid <- raster(extent(FRA)) # Choose its resolution. I will use 2 degrees of latitude ...
-3
votes
1answer
1k views

How to locate pixels and bands of image in R [closed]

the format is tiff I have read a tiff image and plot it how to locate pixels and bands of this image now
-3
votes
0answers
20 views

Creating 3D image from HGT DEM file? [duplicate]

I tried Displaying 3D raster/vector in GRASS from command line?: Error there is no nviz in my GRASS 7.6.x Already tried this too: Error m.nviz.image bad server connection Already see this and the ...
-3
votes
1answer
67 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 ...
-4
votes
1answer
482 views

Exporting glm prediction as raster? [closed]

I have conducted a logistic regression in R using two rasters. I want to export it as a raster layer but I keep getting errors. the code is as follows: S <- stack(sinks, tpi, beer)` rdata <- ...
-4
votes
1answer
28 views

Performing geospatial analysis in R?

I obtained a rectangular sort of image when I subset shapefile on the raster image. I want to get exact irregular shaped image so that I can proceed my classification to that particular area (B is my ...