rm(list=ls())
setwd("C:/users/bok/Desktop")
library(leaflet)
library(readxl)
library(ggplot2)
myData<-read_excel("gggg.xlsx", sheet="Sheet4")
leaflet(structure(list(lat=as.numeric(myData$x), lon=as.numeric(myData$y)))) %>%
addPolylines(lng=~lon, lat=~lat)%>%
ggplot(myData, aes(x,y))+
annotate("rect",xmin=Inf,xmax=0,ymin=Inf,ymax=0, fill= "red") +
annotate("rect",xmin=-Inf,xmax=0,ymin=-Inf,ymax=0 , fill= "blue") +
annotate("rect",xmin=0,xmax=Inf,ymin=0, ymax=-Inf, fill= "yellow") +
annotate("rect",xmin=0,xmax=-Inf,ymin=Inf,ymax=0, fill= "green") +
geom_point()+xlim(-10,10)+ylim(-10,10)
myData - это просто координаты x, y .. Результат - просто квадранты с точками на цветном фоне. Как объединить две функции leafet () и ggplot () ??