Skip to contents

Helper function to get the data inside the map data The urls are listed in https://code.highcharts.com/mapdata/.

Usage

get_data_from_map(mapdata)

Arguments

mapdata

A list obtained from download_map_data.

Examples

dta <- download_map_data("https://code.highcharts.com/mapdata/countries/us/us-ca-all.js")
get_data_from_map(dta)
#> # A tibble: 58 × 7
#>    `hc-group` `hc-middle-x` `hc-middle-y` `hc-key`  `hc-a2` fips  name          
#>    <chr>              <dbl>         <dbl> <chr>     <chr>   <chr> <chr>         
#>  1 admin2              0.51          0.29 us-ca-083 SB      06083 Santa Barbara 
#>  2 admin2              0.45          0.24 us-ca-111 VE      06111 Ventura       
#>  3 admin2              0.38          0.46 us-ca-071 SB      06071 San Bernardino
#>  4 admin2              0.27          0.69 us-ca-115 YU      06115 Yuba          
#>  5 admin2              0.55          0.48 us-ca-101 SU      06101 Sutter        
#>  6 admin2              0.63          0.5  us-ca-031 KI      06031 Kings         
#>  7 admin2              0.34          0.59 us-ca-053 MO      06053 Monterey      
#>  8 admin2              0.2           0.54 us-ca-057 NE      06057 Nevada        
#>  9 admin2              0.4           0.34 us-ca-059 OR      06059 Orange        
#> 10 admin2              0.51          0.54 us-ca-065 RI      06065 Riverside     
#> # … with 48 more rows