1
votes

I am using R studio 3.5.1 on windows 7 in China. I installed devtools and trying to install other packages like REmap, but I'm unable to download packages from GitHub.

I got the following errors:

library(devtools)
install_github('lchiffon/REmap')

Error in read.dcf(path) : Found continuation line starting ' interactive map ...' at begin of record.

install_git("https://github.com/Lchiffon/REmap")

Downloading git repo https://github.com/Lchiffon/REmap

  File C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file55385d2e4379 contains

invalid line(s) %TSD-Header-###%o物浸变,MT橰 They were ignored

  File C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file55381faa65e6 contains

invalid line(s) %TSD-Header-###%p物浸变,MT橰 77w珰L懫 They were ignored 错误: 1:1: 意外的SPECIAL 1: %TSD-Header-###% ^ 停止执行 Error in processx::run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), : System command error

I tried other packages as well.

devtools::install_github("dengfei2013/GS")

Downloading GitHub repo dengfei2013/GS@master

gzip: stdin: not in gzip format /Rtools/bin/tar: Child returned status 1 /Rtools/bin/tar: Error is not recoverable: exiting now External tar failed with --force-local, trying without

gzip: stdin: not in gzip format /Rtools/bin/tar: Child returned status 1 /Rtools/bin/tar: Error is not recoverable: exiting now External tar failed with --force-local, trying without Error: Does not appear to be an R package (no DESCRIPTION) In addition: Warning messages: 1: In utils::untar(tarfile, ...) : ‘tar.exe -zxf "C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file553843c77145.tar.gz" -C "C:/Users/heqi/AppData/Local/Temp/RtmpKsksur/remotes553857a6482"’ returned error code 2 2: In system(cmd, intern = TRUE) : running command 'tar.exe -ztf "C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file553843c77145.tar.gz"' had status 2

I tried to change some of the options but the results are the same.

options(download.file.method = "wget")
options(unzip = "internal")
install_github('r-lib/remotes')

Downloading GitHub repo r-lib/remotes@master

gzip: stdin: not in gzip format /Rtools/bin/tar: Child returned status 1 /Rtools/bin/tar: Error is not recoverable: exiting now External tar failed with --force-local, trying without

gzip: stdin: not in gzip format /Rtools/bin/tar: Child returned status 1 /Rtools/bin/tar: Error is not recoverable: exiting now External tar failed with --force-local, trying without Error: Does not appear to be an R package (no DESCRIPTION) In addition: Warning messages: 1: In utils::untar(tarfile, ...) : ‘tar.exe -zxf "C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file553845a824ac.tar.gz" -C "C:/Users/heqi/AppData/Local/Temp/RtmpKsksur/remotes553845fa49b"’ returned error code 2 2: In system(cmd, intern = TRUE) : running command 'tar.exe -ztf "C:\Users\heqi\AppData\Local\Temp\RtmpKsksur\file553845a824ac.tar.gz"' had status 2 >

I am trying to do a heat map analysis, but I can't use REmap, and I can't open google API maps...

> library(ggplot2)
> library(ggmap)
> map <- get_map(location = 'united states', zoom =4 ,maptype =
                  'terrain', source = 'google',color ='color')

Error in download.file(url, destfile = tmp, quiet = !messaging, mode = "wb") : cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=united+states&zoom=4&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false' In addition: Warning message: In download.file(url, destfile = tmp, quiet = !messaging, mode = "wb") : URL 'http://maps.googleapis.com/maps/api/staticmap?center=united+states&zoom=4&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false': status was 'Failure when receiving data from the peer' >

Other information

I am an intern at an online credit loan company, they are using encryptions to encrypt the files so that you can't open it unless you are using the company's computers. I don't know how they do it but I ran into a lot of problems when I am trying to learn R.

I remember that I ran into some file reading problems last time. Could this have anything to do with it?

I downloaded the zip file from GitHub

> install.packages("C:/Users/heqi/Desktop/REmap-master.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/heqi/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
> library(`REmap-master`)
Error in library(`REmap-master`) : 不存在叫‘REmap-master’这个名字的程辑包
> library(`REmap`)
Error in library(REmap) : 不存在叫‘REmap’这个名字的程辑包
> install.packages("C:/Users/heqi/Desktop/baidumap-master.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/heqi/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
> library(`baidumap`)
baidumap 0.2.2
Apply an application from here: http://lbsyun.baidu.com/apiconsole/key
Then register you key by running `options(baidumap.key = 'xxx')`
> options(baidumap.key = 'qKBOY2C0s678Dl33wxrTYnbMn9KZCRu5')
> baidumap::getBaiduMap(location = "上海")
trying URL 'http://api.map.baidu.com/staticimage?width=400&height=400&center=NA,NA&zoom=10&scale=2'
Content type 'image/png' length 154 bytes
downloaded 154 bytes

Map from URL : http://api.map.baidu.com/staticimage?width=400&height=400&center=NA,NA&zoom=10&scale=2
Error in data.frame(ll.lat = ll[1], ll.lon = ll[2], ur.lat = ur[1], ur.lon = ur[2]) : 
  arguments imply differing number of rows: 0, 1
In addition: Warning messages:
1: In trans(result) : NAs introduced by coercion
2: In trans(result) : NAs introduced by coercion

I also tried GitHubinstall,It's all the same

 > library("githubinstall", lib.loc="~/R/win-library/3.5")
    > githubinstall::gh_install_packages('REmap')
    Suggestion:
     - Lchiffon/REmap  create  a map by R
    Do you want to install the package (Y/n)?  y
    Error in read.dcf(path) : 
    Found continuation line starting '    interactive map  ...' at begin of recor

d.

I think it's not because of the commands but the config of my system?

I am really new to Rstudio, someone suggested me to download the packages to local, then install. Can someone show me how to do that using terminal?

1
REmap is not in CRAN, I suppose? Idon't know how to install packages from GitHub using install.packages...I tried use githubinstall.QI.HE
<pre> <code> library("githubinstall", lib.loc="~/R/win-library/3.5") > githubinstall::gh_install_packages('REmap')QI.HE

1 Answers

0
votes

I have had a similar problem on both my own package and another one. The error on my package was in the Description: block of the DESCRIPTION file. Even though this is supposed to be a thorough description, the only thing that worked to fix it, in my multiple attempts, was to reduce this entry to one line.

The other package I was trying to load has the problem in the Authors@R: field. It looks fine compared to another I sampled, except perhaps that the closing paren is not on a separate line.