From 3a40319b7269b98d4df9bfeb5d1c467fabd2307a Mon Sep 17 00:00:00 2001 From: Damonsoul <244085168@qq.com> Date: Tue, 5 Nov 2024 09:18:47 +0800 Subject: [PATCH] update example --- R/addAreaPolygons.R | 4 ++-- R/areaCalculator.R | 2 +- man/addAreaPolygons.Rd | 6 ++++-- man/areaCalculator.Rd | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/R/addAreaPolygons.R b/R/addAreaPolygons.R index 70d0013..4896698 100644 --- a/R/addAreaPolygons.R +++ b/R/addAreaPolygons.R @@ -14,8 +14,8 @@ #' library(leaflet) #' m <- leaflet() %>% addTilesAmap() #' m <- addAreaPolygons(m, -#' longitude = c(116.404, 116.407, 116.409), -#' latitude = c(39.916, 39.919, 39.917), coordinate = "WGS-84" +#' longitude = c(31.1, 39.919, 39.917), +#' latitude = c(121.0, 121.1, 121.2), coordinate = "WGS-84" #' ) #' m addAreaPolygons <- function(map, longitude, latitude, coordinate = "WGS-84") { diff --git a/R/areaCalculator.R b/R/areaCalculator.R index 9739892..90fefc1 100644 --- a/R/areaCalculator.R +++ b/R/areaCalculator.R @@ -14,7 +14,7 @@ #' #' @examples #' area <- areaCalculator( -#' latitude = c(31.0, 31.1, 31.2), +#' latitude = c(31.1, 39.919, 39.917), #' longitude = c(121.0, 121.1, 121.2), coordinate = "WGS-84" #' ) areaCalculator <- function(longitude, diff --git a/man/addAreaPolygons.Rd b/man/addAreaPolygons.Rd index 8b01b85..2bfeda6 100644 --- a/man/addAreaPolygons.Rd +++ b/man/addAreaPolygons.Rd @@ -24,7 +24,9 @@ This function adds a polygon area to a given map using the specified latitude an \examples{ library(leaflet) m <- leaflet() \%>\% addTilesAmap() -m <- addAreaPolygons(m, longitude = c(116.404, 116.407, 116.409), - latitude = c(39.916, 39.919, 39.917), coordinate = "WGS-84") +m <- addAreaPolygons(m, + longitude = c(31.1, 39.919, 39.917), + latitude = c(121.0, 121.1, 121.2), coordinate = "WGS-84" +) m } diff --git a/man/areaCalculator.Rd b/man/areaCalculator.Rd index 725cbd6..c9d0096 100644 --- a/man/areaCalculator.Rd +++ b/man/areaCalculator.Rd @@ -24,6 +24,8 @@ This function takes in latitude and longitude vectors and calculates the area of defined by those points. It can handle different coordinate systems such as WGS-84, GCJ-02, and BD-09. } \examples{ -area <- areaCalculator(latitude = c(31.0, 31.1, 31.2), -longitude = c(121.0, 121.1, 121.2), coordinate = "WGS-84") +area <- areaCalculator( + latitude = c(31.1, 39.919, 39.917), + longitude = c(121.0, 121.1, 121.2), coordinate = "WGS-84" +) }