Questions tagged [rstudio]

An environment (IDE) for R. Do not use this tag for R questions unrelated to the Studio environment.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Making single depth raster layer (0-30cm) using three layers (0-5cm, 5-15cm and 15-30cm) for sand, silt, clay & OC using R

I have tried to do that on Rstudio using the "Trapezoidal rule". library(raster) library(rgdal) library(sp) a <-raster("D:Soildata/SOC_0-5mos.tif") b <-raster("D:...
0 votes
2 answers
49 views

SpatialPolygonDataFrame to raster while keeping categorical values

I have a SpatialPolygonDataFrame which I need to convert to raster in R while keeping the categorical values of the polygon. I have tried various approaches but I have always either lost the values or ...
  • 3
0 votes
0 answers
66 views

Error while using readOGR to import shapefiles

I am using a Mac System and unable to read shape file. states12 <- readOGR(dsn = ".", layer= "cb_2018_us_state_500k", verbose=TRUE) The Error I am getting RStudio is Quitting ...
0 votes
0 answers
86 views

Incorrect number of dimensions in creating multiple plots using a for loop with ggplot2

I'm trying to map out all these different "solutions" from the prioritize model using ggplot. (To preface I'm very new to R so perhaps my code/methods are extremely rudimentary and why I'm ...
  • 1
0 votes
1 answer
19 views

R Markdown Knitting Produces Garbage

I don't even know where to begin on describing my problem. I made some maps in R Studio and when I knit the document, it gives me 30 pages of junk. I have selected the options to display the output ...
0 votes
1 answer
167 views

How to display all the column values of overlapping polygons in leaflet popup with R?

I have intersected points data with a grid in which I would like to display the name of all the species found in every cell. Code sample: library(dplyr) library(rgdal) library(leaflet) library(sf) ...
  • 1,607
0 votes
0 answers
76 views

Cropping and masking rasterstack to a list of shapefiles

I have a raster stack (nlayers = 366, ncells~10 million). I am hoping to crop and mask this raster stack to a data.frame of coordinates for which I have made a series of concentric circle shapefiles ...
  • 33
1 vote
0 answers
44 views

Creating a loop to create NDVI images from raster stacks and naming them from the file name [closed]

I have been trying to write a loop to go through two folders of Sentinel 2 satellite images (Band 4 and 5) and get a NDVI for each date. A stack is created for each band, some cropping and resampling ...
0 votes
1 answer
84 views

QGIS filter to get a mesh or fishnet with spaces without information

Can I create a filter with a Python code or R code, to eliminate the spaces that don't belong to the orange shape file? I was thinking in to each shapefile meshed, assign an area from orange shapefile....
2 votes
2 answers
269 views

Randomly sampling polygons from polygon grid using the spatialEco package in R

I have a polygon grid (epsg:24381) from which I want to randomly select some polygons. Whenever I try to perform the sampling I'm getting the following error: Error in h(simpleError(msg, call)): ...
  • 367
1 vote
1 answer
259 views

How to cluster 1000+ points into 50 clusters based on geospatial proximity in R?

Sample data: set.seed(123) lon <- runif(1200, 72.6, 73.2) lat <- runif(1200, 18.8, 19.6) df <- data.frame(lon, lat) Progress so far: geo.dist = function(df) { require(geosphere) d <- ...
1 vote
1 answer
229 views

Problem of marker click with Leaflet

I am new using Leaflet with R studio and I have a problem ou both Leaflet markers and map_marker click . The first problem is that , when I put addCircleMarkers in the observer in doesn't work while ...
4 votes
1 answer
6k views

R: Using st_intersects to classify points inside, outside and within a buffer

I have two objects, a shapefile of location points, points, and a shapefile of polygons, world_buffer (both +proj=utm +datum=WGS84). The world_buffer is the world's coastlines, found here, with a 5 km ...
  • 215
0 votes
1 answer
333 views

Classifying points within polygon, outside of polygon OR within buffer at polygon edge using R

I have two objects, a SpatialPointsDataFrame, "points" and a SpatialPolygonsDataFrame, "world_buffer" (both +proj=utm +datum=WGS84). The SpatialPolygonsDataFrame is the world's ...
  • 215
0 votes
1 answer
98 views

Does not display Map in Rstudio using Python Package - GEEMAP

I am trying to use the GEEMAP package of Python in RStudio-1.4.1106. After importing the packages and running the code shown below MAP is not displayed rather it displays the MAP attributes in the ...
0 votes
1 answer
189 views

Doing exp math in R/Google Earth Engine (rgee)

Is this the correct syntax in R-Studio for rgee (Google Earth Engine) for the following equation? y=0.7*e^(4.1*x) where x is represented by "data" below. y<-data$multiply(4.1)$exp()$...
0 votes
1 answer
411 views

Select all images in image collection Google Earth Engine in R Rgee to mosaic

Is there a way to select all images in an image collection in Google Earth Engine or using Rgee? I want to select all the images in an image collection after filtering the collection and then mosaic ...
1 vote
1 answer
353 views

Add marker to coordinates Leaflet

i work with RStudio and Leaflet. I like to add inputboxes to type coordinates into them. Then the code should set a marker on this point and zoom on it. How can i do this? I tried to manipulate the ...
  • 11
2 votes
0 answers
190 views

How to apply Sen2cor in sen2r graphical user interface?

I have recently installed the sen2r plugin in r for extracting level 1 Sentinel-2 images from ESA's Long Term Archive and using sen2cor correction to obtain level 2 scenes. An issue I face is that the ...
  • 548
1 vote
1 answer
355 views

How to remove areas of water from the US census tract map using R/RStudio

I am trying to aggregate all of the census tracts in the United States for analysis and display, including a realistic depiction of water features when zoomed in. I run into memory issues when doing ...
  • 51
0 votes
0 answers
28 views

Can't join coordinates to polygons represented by black icons in RStudio viewer

I'm using {sf} to import a GeoJSON file. What does the black icon represent? I'm trying to join coordinates to this object via st_join(ken_con_sf, join = st_within) and it seems to fail where ...
1 vote
2 answers
6k views

Exporting shapefile from RStudio

Please can someone show me how to export a file from R in the format of a shapefile in order to be used in GeosegregationAnalyzer (which requires a shapefile). I have merged attribute data with the ...