Matheus Regis
Matheus Regis

Reputation: 13

How to plot a txt data in a shape file in R?

i have a txt data where each line is one lightning with lat, lon and intensity, i want to plot this upper a shapefile (polygon).

I cant read the shapefile, and i dont know how to plot the data upper the shapefile, anyone can help me? Maybe with some idea ..

Upvotes: 1

Views: 260

Answers (1)

Roman Luštrik
Roman Luštrik

Reputation: 70643

Package sp is your friend here.

library(sp)

data(meuse)

str(meuse)

coordinates(meuse) <- ~ x + y
plot(meuse)

You could also could give package sf a try. See vignettes.

Upvotes: 1

Related Questions