0

I am having terrible trouble installing the broom package on my windows PC

I have tried installing from source using the .tar.gz and from CRAN using dependencies = TRUE, all to no avail.

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
  running command '"C:/Program Files/R/R-34~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\60129180\Documents\R\win-library\3.4" C:\Temp\RtmpOM6Pkn/downloaded_packages/broom_0.4.3.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘broom’ had non-zero exit status
Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55
llewmills
  • 2,959
  • 3
  • 31
  • 58
  • 7
    The error is telling you it is a problem with a space in your *path* (*i.e.* ProgramFiles. When I need to use windows, I setup a library like `C:/R/library` where this problem doesn't arise. You can make the directory and try `install.packages("broom", lib = "C:/R/library")` – Kevin Arseneau Nov 23 '17 at 23:49
  • You get this error because the folder in `C:` whose name is "Program Files" contains a space in it. Your system interprets `C:\Program` as a command (referring to an executable somewhere on your disk) and considers `Files/R/R-34~1.1/bin/x64/R` as an argument of this command. Did you get this error manually or programmatically ? If the latter, which command did you use exactly ? – keepAlive Nov 23 '17 at 23:54
  • Thank you @Kevin Arsenau and @Kanak, but I just installed the `BayesFactor` package without a problem. Why would one package object to the space but the other not? – llewmills Nov 24 '17 at 02:27
  • @llewmills: because. Sorry, it's "because". I agree and am somewhat disappointed that having a space in the path is a problem for a modern programming language, but that is the way it is. However, the two optional fixes are both easy to do and do not adversely affect other packages. (The two solutions: (a) install R elsewhere than `c:/Program Files/R/...`; or (b) use a personal library that does not have a space in the path.) – r2evans Nov 24 '17 at 03:45
  • @r2evans yes I am reconciled to having to work out how to do this. But it's not the R programming language generally that has this problem, it's the `broom` package only. Other packages within R install just fine and they are presumably using the same 'spaced' file path as `broom`. Oh well. Onwards and upwards. – llewmills Nov 24 '17 at 04:15
  • I hear what you're saying, but it pops up in much more than just the `broom` package (though I confess not all or even many). I battled with this several years ago well before [`broom`'s first commit](https://github.com/tidyverse/broom/commit/5788a14ae5ee503e24073a019c9ec69e379a1f9b) in July 2014. – r2evans Nov 24 '17 at 04:20
  • Hadley moves in mysterious ways, In Hadley we trust etc. – llewmills Nov 24 '17 at 04:24
  • show me how exactly you do the install and I will help you sort out the path. – Gerhard Nov 24 '17 at 06:33
  • Thank you for the offer @Gerhard Barnard but three days later it installed with `install.packages("broom", dependencies = TRUE)`. I restarted my computer as an attempted fix last Friday and that didn't work, so I have no idea what changed over the weekend, but it's working now. – llewmills Nov 27 '17 at 01:21

1 Answers1

1

If it helps I would like to share my experience in this topic. I recently had exactly the same problems when installing the broom package. In short, I tried all the proposed methods of installing it and all of them shown the same error messages, I even wrote to one of the developers and was told to install it as:

devtools::install_github("bbolker/broom")

and again the same errors. I did not try to change the directory and I ignored the "space" problem in the path. Then, I shut off my PC, tried to open the package and again it did not work but I did not try to install it again because I had verified that the folder of the package with all its documentation was there. Then I simply updated absolutely all my packages with the automatic function from the R toolbar options and after some minutes when it finished I called the broom package and this time to my surprise it worked.

I hope this is useful to someone else, at least it is another way to solve the problem and it worked for me after searching for a couple of days on the web.

tuomastik
  • 4,559
  • 5
  • 36
  • 48