0

I would like to install the r superheat package but I don't have access to github so I cannot use devtools.

I was looking here:

How to install a package from a download zip file

and I see to install a package from a zip file do

setwd("C:/Users/Desktop/")
unzip("rvest-master.zip")
file.rename("rvest-master", "rvest")
shell("R CMD build rvest")
install.packages("rvest_0.2.0.9000.tar.gz", repos = NULL)

so I downloaded the superheat zip file from the github page https://github.com/rlbarter/superheat and I want to do the code below BUT

I get this error:

 shell("R CMD build superheat")
'\\mycompany.com\MYDOCS\My' is not recognized as an internal or external command,
operable program or batch file.
Warning messages:
1: running command 'C:\Windows\system32\cmd.exe /c R CMD build superheat' had status 1 
2: In shell("R CMD build superheat") :
  'R CMD build superheat' execution failed with error code 1
on this line

I think it it because the R program is in the "MY DOcuments" folder which has a space in the path. Is there a workaround?

Thank you.

these are the lines I am running

setwd("C://Users//Desktop/")
unzip("superheat-master.zip")
file.rename("superheat-master", "superheat")
shell("R CMD build superheat")

when I run this

shell("//mycompany.com/MyDocs/My Documents/R/R-3.4.0/bin/R.exe CMD build superheat")

I still get the same error

Community
  • 1
  • 1
user3022875
  • 8,598
  • 26
  • 103
  • 167
  • 1
    What do you mean you don't have access to github? If you were able to download the zip file, then you should be able to use `install.packages("devtools"); devtools::install_github("rlbarter/superheat")`. Where exactly does the problem occur? – MrFlick May 12 '17 at 15:22
  • my connection blocks the github devtools downloads but I am able to download the zip. This is a known issue for me. I am just wondering how to install from the zip. Please do not mark this as duplicate as this is not an exact duplicate. In my case there is no tar.gz file like the original post which I referenced. – user3022875 May 12 '17 at 15:29
  • I read the entire post from Thomas. I don't see where he says anything about building a tar bar. What am I missing? – user3022875 May 12 '17 at 15:44
  • Ok thank you. The shell command is not working looks like an issue with my shell and R but I should still be able to build using the "build" button after opening the RProj file correct? Do you know which file inthe RProj I should build? – user3022875 May 12 '17 at 15:55
  • Update your question with the specific error you are getting. That would help. – MrFlick May 12 '17 at 15:56
  • @MrFlick please see update. when I run the R CMD build I get a status 1 error – user3022875 May 12 '17 at 19:49
  • That's really all the error says? There's no other message? I added some info to the duplicate about making sure your system path is correct, but I would have expected a slightly different error message. You are on windows, right? – MrFlick May 12 '17 at 19:55
  • ooops I didnt see this It says: shell("R CMD build superheat") '\\mycompany.com\MYDOCS\My' is not recognized as an internal or external command, ..... I think that is because the path is to a folder with a space 'My Documents' and it fails when it hits the sapce after 'My '? Is there a way I can get around this or build it manually with the build button in rstudio? – user3022875 May 12 '17 at 20:13
  • That error still seems odd. But if you look in the folder where the project was unzipped, there should be a .Rproj file in there. If you open that in Rstudio, then you can try using the Build...Build and Reload menu to load the package. – MrFlick May 12 '17 at 20:23
  • WHen I open the RProj and hit the build an reload button I get teh same error. It doesn't like the space in the path to the R.exe – user3022875 May 12 '17 at 20:28
  • But you are literally running `shell("R CMD build superheat")`? You're not putting the full path to R in the shell command, right? Have you got your PATH variable set correctly? If so, then `shell("where R")` should work. – MrFlick May 12 '17 at 20:31
  • When I run shell("//mycompany.com/MyDocs/My Documents/R/R-3.4.0/bin/R.exe CMD build superheat") I still get the same error i think because there is a space between my and documents – user3022875 May 12 '17 at 20:43
  • Is there a workaround for that? – user3022875 May 12 '17 at 20:43
  • Ugh, that's not what you said you were running. You really need be more careful in describing what you are really doing in order for us to help you properly. If you would have just updated your PATH, this would have been fine. If you insist on running it this way, use `shell(paste(shQuote("//mycompany.com/MyDocs/My Documents/R/R-3.4.0/bin/R.exe"), "CMD build superheat"))` Basically the problem that's discussed here: http://stackoverflow.com/questions/20568081/problems-with-spaces-in-paths-when-calling-a-batch-file-from-r – MrFlick May 12 '17 at 20:49
  • I apologize. Now when I run shell(paste(shQuote("//mycompany.com/MyDocs/My Documents/R/R-3.4.0/bin/R.exe"), " CMD build superheat")) I still get the same error is ".../My' not recognized as an internal or external command, operable program or batch file." – user3022875 May 12 '17 at 20:53
  • What version of Windows? What version of RStudio? What version of R? What does `R.home("bin")` return? – MrFlick May 12 '17 at 20:54
  • r 3.4. r studio 1.0.143 , windows 7 – user3022875 May 12 '17 at 20:59
  • Sorry, I added another part. What does `R.home("bin")` return? – MrFlick May 12 '17 at 21:00
  • it returns: //mycompany.com/MYDOCS/My Documents/R/R-3.4.0/bin/x64 when I change the path and add on/x64/R.exe it still gives same error – user3022875 May 12 '17 at 21:02
  • Well I found the tar on github and downloaded it and when I run install I get an error. http://stackoverflow.com/questions/43946900/tar-gz-not-installing-for-r-3-4 Do I need an earlier version of R? – user3022875 May 12 '17 at 21:47

0 Answers0