Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

R functions of shp

$
0
0

I'm trying to read my shapefile in R and still getting an error message

I installed these libraries

library(sf)
library(ggplot2)
library(tmap)
library(tmaptools)
library(leaflet)
library(dplyr)

mydata<-st_read("C:/Users/User/Documents/PlotLocations_HARV.shp",stringsAsFactors = FALSE)

I got this error message:

Cannot open data source C:\Users\User\Documents\PlotLocations_HARV.shp
Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type,  : 
  Open failed.
In addition: Warning message:
In CPL_read_ogr(dsn, layer, as.character(options), quiet, type,  :
  GDAL Error 4: Unable to open C:\Users\User\Documents\PlotLocations_HARV.shx or C:\Users\User\Documents\PlotLocations_HARV.SHX.Try --config SHAPE_RESTORE_SHX true to restore or create it

I have the entire file as well
aoi_boundary_HARV <- st_read("C:\Users\rhusein\Documents\NEONDSSiteLayoutFiles\NEON-DS-Site-Layout-Files\HARV\HarClip_UTMZ18.shp")

and still getting the error message

Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type, : Open failed. – julia 1 hour ago

Verify that the file PlotLocations_HARV.shx exists in the same folder as PlotLocations_HARV.shp

yes both are in the folder

now I am good thanks


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>