You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Load REmap package## https://github.com/Lchiffon/REmap
require('REmap')
## Reinitialized the REmap setting
suppressAll(remap.init())
## Get world city geocode from simplemaps.com## https://simplemaps.com/data/world-citiesgeodata<-maps::world.cities|>dplyr::rename(city=name, country=country.etc, lon=long) |>dplyr::select(country, city, capital, lon, lat, pop) |>dplyr::filter(city%in% c('Zhengzhou', 'Kuala Selangor',
'Tanjong Karang', 'Klang', 'Seri Kembangan',
'Serdang', 'Equine Park') |capital!=0)
countries<-geodata$country|>
unique()
## randomly set country codesdata<-data.frame(
country=countries,
value=5* sample(length(countries)) +200)
## citiesvec<-geodata$city## lon & lat of citiesgeodata<-geodata|>data.frame() |>dplyr::select(lon, lat, city) |>dplyr::rename(vec=city)
## Design a line data framemarkLinedata<-data.frame(
origin= rep('Zhengzhou', (length(vec) -1)),
destination=geodata$vec[!geodata$vec%in%'Zhengzhou'])
原著:
由于百度地图自从前几年开始只限制中国同胞注册为百度开发人员才能使用,导致无法正常使用。故此尝试修改全球地图数据来源,而且目前正在科研高频量化对冲交易论文内容、函数、代码都一律汉化,所以尝试将此REmap原版(原著:郎大为http://langdawei.com) ,稍微修改一下为REmap程序包中文版(百度绘图),也是第一个使用中文编程的R语言程序包。
maps::world.cities
程序包内数据即可。maps::world.cities
程序包内数据已加工并储存在REmap
程序包的附属数据地图数据.csv
。以下数据经过翻译并储存,读取后即可使用。
个人简历中,尝试导入中文地图数据,使用以上原版
REmap::remapC()
。REmap
🐾百度绘图,🌟点缀全球 scibrokes/r-world#1REmap::remapC():Error in if (markLineLogi & markPointLogi & !geoDataLogi) { : the condition has length > 1
scibrokes/owner#6Error in if (markLineLogi & markPointLogi & !geoDataLogi) { : the condition has length > 1
Lchiffon/REmap#61The text was updated successfully, but these errors were encountered: