0

I'm trying to load papaja in R (version 3.6.0). I'm running Windows 10 on my computer. When I try to run devtools::install_github("crsh/papaja") I get the following error message:

 package ‘markdown’ successfully unpacked and MD5 sums checked

 The downloaded binary packages are in
     C:\Users\My 
 Name\AppData\Local\Temp\RtmpKCmBDG\downloaded_packages
     ERROR
    cannot change to directory 'C:\Users\My'
    The system cannot find the path specified.
 Error in (function (command = NULL, args = character(), error_on_status = 
 TRUE,  : 
   System command error

From some research, including this post and this post, I realise that this is a common issue, but none of the answers I can find help me work around this in papaja.

For info, I don't have this problem when installing other packages using install.packages().

crsh
  • 1,699
  • 16
  • 33
Catherine Laing
  • 475
  • 6
  • 18
  • Hi Catherine, can you install other packages from GitHub (e.g., `install_github("crsh/citr")`? – crsh Jun 11 '19 at 12:08
  • Hi, no this won't work either - I get the same error message unfortunately. – Catherine Laing Jun 11 '19 at 14:19
  • 1
    Okay, thanks. This suggests to me that your problem is not specific to `papaja` but probably a more general problem with `devtools::install_github()` when the path contains whitespace. Am I right to assume that the error message relates to the installation of the `markdown` package? Was the package successfully installed nonetheless? – crsh Jun 11 '19 at 15:31
  • Ok, so I updated `markdown` and I think it is now working! I need to run a few other things to check (which I will do later this week). Thanks so much (and sorry for the slow response, I have just come back from 2 weeks of holiday)! – Catherine Laing Jul 01 '19 at 09:07

1 Answers1

2

I have managed to solve this problem after hours and hours of googling. The problem is not papaja; it is the presence of spaces in the path, which devtools does not deal with well.

To solve this, I first changed my library path:

.libPaths("C:/Program Files/R/R-3.6.1/library") # for R v.3.6.1

At first I couldn't get this to work - I kept getting the error 'lib = "C:/Program Files/R/R-3.6.1/library"' is not writable. Basically, this is because I did not have permission to write into this folder. To fix this, you simply close RStudio, go to the folder where the programme is saved and right click, then select 'Run as administrator'.

Catherine Laing
  • 475
  • 6
  • 18