read shapefile is giving an error

Hey guys,

I am trying to read a shape file using the function "st_read" and this error shows:

Error in make.names(vnames, unique = TRUE) : invalid multibyte string 6

I already read others shapefiles and it works, but now I am facing it for a long time and still did not find a solution.

I tried this:

Sys.setlocale("LC_ALL", "en_US.UTF-8") 
st_read(paste0(harvestfolder, "/", Filename), fileEncoding="utf8")

but nothing seems to be working. Anyone could help me?


Have you tried other means of reading in the shape file.

shape <- readOGR(dsn = ".", layer = "SHAPEFILE")

Are you also sure that the encoding is correct?
See here:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.