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
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")
AUS<-subset(line,country=="AUS"|country=="JPN")
CHN<-subset(line,country=="CHN"|country=="JPN")
NZL<-subset(line,country=="NZL"|country=="JPN")
DEU<-subset(line,country=="DEU"|country=="JPN")
library(leaflet)
x<-leaflet()
x<-addTiles(x)
x<- addPolylines(x,lng = USA$long,lat = USA$lat,weight = USA$import)
x<- addPolylines(x,lng = AUS$long,lat = AUS$lat,weight = AUS$import)
x<- addPolylines(x,lng = CHN$long,lat = CHN$lat,weight = CHN$import)
x<- addPolylines(x,lng = NZL$long,lat = NZL$lat,weight = NZL$import)
x<- addPolylines(x,lng = DEU$long,lat = DEU$lat,weight = DEU$import)
x
日米航路
library(readr)
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(geosphere)
JPNcenter<-c(137.96,37.54)
USAcenter<-c(-112.98,45.72)
gcUSA1<-gcIntermediate(JPNcenter,USAcenter,addStartEnd = TRUE)
library(leaflet)
y<-leaflet()
y<-addTiles(y)
y<-addPolylines(y,data = gcUSA1,col='red')
y
航路
library(readr)
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.
JPN<-subset(line,country=='JPN')
USA<-subset(line,country=='USA')
AUS<-subset(line,country=='AUS')
CHN<-subset(line,country=="CHN")
NZL<-subset(line,country=="NZL")
DEU<-subset(line,country=="DEU")
library(geosphere)
JPNcenter<-JPN[,c(3:4)]
USAcenter<-USA[,c(3:4)]
AUScenter<-AUS[,c(3:4)]
CHNcenter <- CHN[, c(3:4)]
NZLcenter <- NZL[, c(3:4)]
DEUcenter <- DEU[, c(3:4)]
gcUSA2<-gcIntermediate(JPNcenter,USAcenter,sp = TRUE,addStartEnd = TRUE,breakAtDateLine = TRUE)
gcAUS2<-gcIntermediate(JPNcenter,AUScenter,sp = TRUE,addStartEnd = TRUE,breakAtDateLine = TRUE)
gcCHN2 <- gcIntermediate(JPNcenter, CHNcenter,sp = TRUE,addStartEnd = TRUE, breakAtDateLine=TRUE)
gcNZL2 <- gcIntermediate(JPNcenter, NZLcenter,sp = TRUE,addStartEnd = TRUE, breakAtDateLine=TRUE)
gcDEU2 <- gcIntermediate(JPNcenter, DEUcenter,sp = TRUE,addStartEnd = TRUE, breakAtDateLine=TRUE)
library(leaflet)
y<- leaflet()
y<- addTiles(y)
y<-addPolylines(y,data = gcUSA2,col="blue",weight = USA$import,label =USA$import,popup = "USA")
y<-addPolylines(y,data = gcAUS2,col="red",weight = AUS$import,label =AUS$import,popup = "AUS")
y<-addPolylines(y,data = gcCHN2,col="yellow",weight = CHN$import,
label =CHN$import,popup = "CHN")
y<-addPolylines(y,data = gcNZL2,col="green",weight = NZL$import,
label =NZL$import,popup = "NZL")
y<-addPolylines(y,data = gcDEU2,col="black",weight = DEU$import,
label =DEU$import,popup = "DEU")
y
天然ガス
library(readxl)
Natural_gus <- read_excel("Natural gus.xlsx")
library(leaflet)
x<-leaflet()
x<-addTiles(x)
x<-addCircles(x,lng = Natural_gus$longitude.x,lat = Natural_gus$latitude.x,radius = Natural_gus$import*30000,popup = Natural_gus$origins)
x
ロシアウクライナ
JPNcenter <-c(137.96, 37.54)
RUScenter <-c(93.85, 66.755)
UKRcenter <-c(30.51069, 50.46730)
library(geosphere)
gcRUS <- gcIntermediate(JPNcenter, RUScenter, addStartEnd = TRUE)
gcUKR <- gcIntermediate(JPNcenter, UKRcenter, addStartEnd = TRUE)
library(leaflet)
y<- leaflet()
y<- addTiles(y)
y<- addPolylines(y,data = gcRUS,col='blue',weight = 9053904133/100000000)
y<- addPolylines(y,data = gcUKR,col='black',weight = 183662260/100000000)
y