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
8 views

I have muiltiple polygons in a shapefile, and want to extract each polygon from a rasterfile and save as separate files

I have 80 polygons in a shapefile, and one complete raster file, I want to extract each polygon from a raster file and save it as a different raster files. numPolygons <- length(shapefile) ...
gis user's user avatar
0 votes
0 answers
11 views

In what units do the rasters need to be to use dismo::biovars?

I want to calculate bioclimatic variables from CHELSA monthly data using the biovars function from the dismo package but the help page doesn't mention in what units the precipitation and temperature ...
c roc's user avatar
  • 25
0 votes
0 answers
16 views

Error in ENMeval when running MaxEnt using R studio

I have an error in ENMeval when running Maxent using R studio. "error is Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 12659, 0" I looked it up ...
하의린's user avatar
0 votes
0 answers
19 views

Split population number by area in R

This is continuation of my previous question. This works in ArcMap as it should. I am now trying to do it in R. I have a polygon that contains the population number. Another polygon is a zone polygon. ...
Dean7's user avatar
  • 358
0 votes
2 answers
134 views

Error while trying to train RandomForest in R

I have this data: diff is the results of image difference from bitemporal imagery, and 2, 4, 6, and 8 is the bands of PlanetScope imagery. When I trying to train this data using RandomForest, ...
Deems's user avatar
  • 17
0 votes
0 answers
44 views

Error installing FIELDimageR in R

I am trying to install the FIELDimageR library, I follow the recommendations indicated on Github, I have tried to install it in the three ways indicated in the install section: form 1 install.packages(...
El Memo de Mileto's user avatar
0 votes
0 answers
61 views

Converting Hansen Global Forest Change 'Forest Loss Year' into panel data structure

I downloaded the hansen deforestation loss year layer from the website (https://earthenginepartners.appspot.com/science-2013-global-forest/download_v1.7.html). It is a single raster with one band. ...
Emma's user avatar
  • 1
0 votes
0 answers
17 views

Unable to draw rasters correctly on leaflet (Y axis mismatch) - issue with projection

I am struggling to project ALL rasters that were extracted from netcdf files to be drawn on a leaflet map in RStudio. There doesn't seem to be any projection or matching issues if I use these rasters ...
chlha's user avatar
  • 31
0 votes
0 answers
24 views

Trying to plot a KDE Map - (points = coordinates) not recognised as an argument

library(ks) library(RColorBrewer) library(sp) setwd("/Users/user/Desktop/Thesis/DATA/") data <- read.csv("whalesharks.csv") coordinates <- data[, c("Longitude", &...
Ami Jess Northam's user avatar
0 votes
2 answers
726 views

Using a downloaded shapefile in ggplot2 and R, readOGR error

I am having trouble taking a downloaded shapefile and using it in R and {ggplot2}. The online instructions (like this one) use code that have the function readOGR(). When I use readOGR(), I get ...
Michaela's user avatar
0 votes
0 answers
41 views

What are the steps of assessing groundwater storge from GRACE-FO NetCDF4 data?

I have GRACE-FO data from 2018 to 2022. I want to calculate the groundwater storage and groundwater depth from the data. How can I do that? I have done the same using the google earth engine, but the ...
Ratnadeep Dutta's user avatar
1 vote
1 answer
76 views

How to prepare RStudio environment so that my local variable of the attributes table of shapefile can be adequately taken by shinyapps.io?

Following code uses shiny and rgdal libraries for developing a shiny application in RStudio. This app displays a sidebarPanel with choices options of selectInput taken arbitrarily from ls("...
xunilk's user avatar
  • 29.7k
0 votes
2 answers
105 views

R problem: Crop Spatialpolygon with another Spatial object returns a square. Why?

I am using the raster::crop function to cut a Shape of multiple polygons (Agricultural Plots Information System) with another polygon (Formal Class spatialPolygonDataframe) and instead of cutting the ...
Helena's user avatar
  • 31
0 votes
1 answer
52 views

ArcGIS Pro R-Bridge won't open geodatabase .shp files

I successfully installed R-bridge to ArcGIS Pro and I am trying to load my feature class from my project on ArcGIS to R, I am trying create a path to a specific shapefile within my geodatabase, This ...
Majorian420's user avatar
0 votes
0 answers
213 views

Error using "if" in R: "== : missing value where TRUE/FALSE needed"

I am using st_covered_by function (from sf package) with a for loop and if statement to create a dummy variable to know if specific points from different municipalities are found inside the polygon of ...
Ferran OA's user avatar
0 votes
0 answers
61 views

Error when installing lidR (Error in .shlib_internal(args))

I am trying to install lidR in rstudio but i get this error Message. installing *source* package 'lidR' ... ** Successfully unpacked package 'lidR' and checked MD5 sums ** using staged installation **...
Purple_Ad's user avatar
0 votes
2 answers
480 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 ...
Kris's user avatar
  • 3
0 votes
0 answers
562 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 ...
Manoranjan's user avatar
0 votes
0 answers
203 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 ...
Nikita's user avatar
  • 1
0 votes
1 answer
59 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 ...
redleg_64's user avatar
0 votes
1 answer
306 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) ...
wanderzen's user avatar
  • 2,082
1 vote
0 answers
114 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 ...
Perrin Remonté's user avatar
0 votes
1 answer
110 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....
Felipe Aranda Delgado's user avatar
2 votes
2 answers
574 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)): ...
Nikos's user avatar
  • 936
1 vote
1 answer
667 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 <- ...
Shibaprasadb's user avatar
2 votes
1 answer
486 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 ...
Hiba Gammar's user avatar
6 votes
1 answer
14k 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 ...
cgxytf's user avatar
  • 235
0 votes
1 answer
766 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 ...
cgxytf's user avatar
  • 235
1 vote
2 answers
196 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 ...
Shabir A.Bangroo's user avatar
0 votes
1 answer
289 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()$...
user181095's user avatar
2 votes
0 answers
260 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 ...
AdoMath's user avatar
  • 568
1 vote
1 answer
775 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 ...
ess's user avatar
  • 71
0 votes
0 answers
32 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 ...
Eric Green's user avatar
2 votes
2 answers
15k 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 ...
Benedict Jones's user avatar