fmt_gps_json: Generate GPS lines data for echarts

Description Usage Arguments Value Examples

Description

Your can see the package/misc files.

Usage

1

Arguments

df

data.frame with starLon, starLat, endLon, endLat.

Value

json txt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
gps_trans <- function(df) {
  test <- select(df, startLon, startLat, endLon, endLat)
  as_tibble(t(apply(test, 1, function(x) {
    x <- as.numeric(x)
    start_gps <- wgs2bd(x[1], x[2])
    end_gps <- wgs2bd(x[3], x[4])
    c(start_gps[1], start_gps[2], end_gps[1], end_gps[2])
  })))
}
usr_data <- purrr::map(usr_ids, ~ filter(pam_data, userId == .x))
all <- map(lapply(usr_data, gps_trans), ~ fmt_gps_json(.x))


## End(Not run)

BruceZhaoR/pjutils documentation built on May 20, 2019, 11:38 a.m.