library(readr)
trade <- read_csv("trade.csv")
## Rows: 5 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): origins, destinations
## dbl (5): import, longitude.x, latitude.x, longitude.y, latitude.y
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
line <- read_csv("line.csv")
## Rows: 6 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): country, countryname
## dbl (3): import, long, lat
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
USA<-subset(line,country=="USA"|country=="JPN")

library(leaflet)
x<-leaflet()
x<-addTiles(x)
x<-addPolylines(x,lng=USA$long,lat = USA$lat, weight=USA$import)
x