install_github('lchiffon/REmap')
Downloading GitHub repo lchiffon/REmap@master
from URL https://api.github.com/repos/lchiffon/REmap/zipball/master
Installing REmap
"f:/Program Files/R/R-3.2.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD \
INSTALL "C:/Users/liweitang/AppData/Local/Temp/RtmpigW5L3/devtools1ee4393a167a/Lchiffon-REmap-a05489f" \
--library="F:/Program Files/R/R-3.2.2/my_library" --install-tests

'f:\Program' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Error: Command failed (1)
21 天 后
Downloading GitHub repo lchiffon/REmap@master
from URL https://api.github.com/repos/lchiffon/REmap/zipball/master
Installing REmap
Installing 1 package: XML
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/XML_3.98-1.4.zip'
Content type 'application/zip' length 4290726 bytes (4.1 MB)
downloaded 144 KB

Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open the connection
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 147456 != reported length 4290726
2: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
3: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open compressed file 'XML/DESCRIPTION', probable reason 'No such file or directory'
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Timeout was reached
8 天 后
[未知用户] 好像是你的XML包安装有问题
17 天 后
```{r}
library(REmap)
set.seed(125)
origin = rep("北京",10)
destination = c('上海','广州','大连','南宁','南昌',
'拉萨','长春','包头','重庆','常州')
dat = data.frame(origin,destination)
out = remap(dat,title = "REmap实例数据",subtitle = "theme:Dark")
plot(out)
```

老师,这段代码直接运行可以做出图,但是再rmarkdown文档里knit HTML时却会出现
library(REmap)
set.seed(125)
origin = rep("北京",10)
destination = c('上海','广州','大连','南宁','南昌',
'拉萨','长春','包头','重庆','常州')
dat = data.frame(origin,destination)
out = remap(dat,title = "REmap实例数据",subtitle = "theme:Dark")
## Warning in get_geo_position(city_vec): 北京 not found.上海 not found.广州
## not found.南宁 not found.南昌 not found.拉萨 not found.长春 not found.包头
## not found.重庆 not found.常州 not found.
plot(out)
## Save img as: C:\Users\YAOCHA~1\AppData\Local\Temp\RtmpEDZIei/ID_20160819145217_243.html
[未知用户] 我也出现这种情况了,估计是编码问题,我试着把中文转成拼音就可以了,有3个无法识别改为 nanning --> nanzningz;nanchang --> nachang 常州是怎么也识别不了,看你有什么别的方法,我试过UTF-8,GBk等格式都不行
6 天 后
[未知用户] 我也遇到了这个问题,请问怎么解决啊?
2 个月 后
> install_github("lchiffon/REmap")
Downloading GitHub repo lchiffon/REmap@master
from URL https://api.github.com/repos/lchiffon/REmap/zipball/master
Installing REmap
"B:/R Programming/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore --quiet CMD INSTALL "C:/Users/Zoe \
Cheng/AppData/Local/Temp/RtmpIpLzT0/devtools50606a5a6aa1/Lchiffon-REmap-faa8a59" \
--library="B:/R Programming/library" --install-tests

'B:\R' is not recognized as an internal or external command,
operable program or batch file.
Error: Command failed (1)

如何解决?
1 个月 后
[未知用户] 你的工作目录需要在C盘
10 天 后
[未知用户] 我好像在运行了这段代码以后R无法连接internet,无法下载包了。。。请问怎么设置回去?
13 天 后
明明安装了,怎么加载不了呢?求助~
>install.packages("C:/Documents and Settings/Administrator/桌面/REmap-master.zip", repos = NULL, type = "win.binary")
> library(`REmap-master`)
Error in library(`REmap-master`) :
there is no package called ‘REmap-master’
3 个月 后
很感兴趣,我想问一下,你的这个网站是实时更新么? 还是隔几天或者几小时更新一下
1 个月 后
你好,我想问一下怎么在REmap上添加图例呢
23 天 后
7 天 后
> install_github('lchiffon/REmap')
Installation failed: Couldn't resolve host name
请问这是咋回事啊?
1 年 后

你好 我输入install_github("lchiffon/REmap")后,显示
Skipping install of 'REmap' from a github remote, the SHA1 (7eabe6f7) has not changed since last install.
Use force = TRUE to force installation
求解决办法

    3 年 后
    ## Reinitialized the REmap setting
    remap.init()
    
    ## Get world city geocode from simplemaps.com
    ## https://simplemaps.com/data/world-cities
    geodata <- readr::read_csv('data/worldcities.csv') |> 
      dplyr::filter(capital == 'primary') |> 
      dplyr::select(lng, lat, country, city) |> 
      dplyr::rename(lon = lng)
    
    countries <- geodata$country |> 
      unique()
    
    ## randomly set country codes
    data = data.frame(country = countries, value = 5 * sample(length(countries)) + 200)
    
    ## cities
    vec <- geodata$city
    
    ## lon & lat of cities
    geodata <- geodata |> 
      data.frame() |> 
      dplyr::select(lon, lat, city) |> 
      dplyr::rename(vec = city)
    
    ## Design a line data frame
    markLinedata = data.frame(origin = rep('Beijing', (length(vec) - 1)), destination = geodata$vec[!geodata$vec %in% 'Beijing'])
    
    ## Plot the REmap shining 
    wmap <- remapC(data, maptype = 'world', 
                   color = c('black', 'black'),
                   theme = get_theme(backgroundColor = 'black'),
                   markPointData = vec, markLineData = markLinedata, 
                   geoData = geodata)
    knitrREmap(wmap, local = FALSE)

    参考文献:https://rpubs.com/chiffon_9797/worldmap