Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not able to install rcall from Github

    Hi users,
    I am trying to install the stable version of the rcall from GitHub from the STATA command line and getting the following errors

    . github install haghish/rcall, stable
    unable to open rcall-3.0.7.zip for writing
    r(603);


    1. I am using Windows 10 Pro , version 21H1 , 64-bit OS
    2. I am using STATA-16 to install rcall
    3. The current R version in my system is R version 4.1.1 (2021-08-10)
    4. The R is installed in "C:\Program Files\R"

    Looking forward to a solution

    I am also sharing the link of the STATA UK conference link for your reference of the rcall command:
    https://www.stata.com/meeting/uk21/

    Best wishes
    Arup







  • #2
    Windows users need to be extra cautious about their "Working Directory" to ensure they have the rights to "read and write" files, which is needed for unzipping anything downloaded from the internet. So first, please report your Stata working directory. This could be a reason for not being able to install the package properly

    Second, the path you are reporting for R is unfortunately wrong. You cannot execute R just by specifying where it is installed. You need the complete path to the ".EXE" file (on windows) or the compiled files on Linux or Mac. For example, it complete path might look like "C:\Program Files\R\R-x.x.x\bin\x64\R.exe". You can examine the file path (on linux, mac, windows) by executing it in shell and it should open R. Then, you know that at least the path is defined correctly.
    ——————————————
    E. F. Haghish, IMBI, University of Freiburg
    [email protected]
    http://www.haghish.com/

    Comment


    • #3
      Hi Haghish,
      Thanks for your response.

      1. Actually the full path the R "C:\Program Files\R\R-4.1.1\bin\R.exe",. However, I can't setpath without installing rcall. The working directory for stata is ".cd
      C:\Program Files (x86)\Stata16".

      I don't know how to check whether my working directory has the right to "read and write file".


      2. As an alternative, I tried installing the development version using the command:
      . github install haghish/rcall

      it install the package but throws an error

      .
      . rcall_check
      rcall could not access R on your system
      invalid syntax
      r(198);

      end of do-file
      r(198);

      So, i thought maybe I need to set path, so when I set the path it worked well. - No error

      . rcall setpath "C:/Program Files/R/R-4.1.1/bin/R.exe"


      However, when I am trying to mimic the following example that you have presented in the UK meeting- I face an error

      sysuse auto
      (1978 Automobile Data)

      . rcall
      ---------------------------------------------------- R (type end to exit) ----------------------
      . df<-st.data()
      file _st.data.dta could not be opened
      r(603);

      So both stable and development versions are not working for me.

      Thanks
      Arup


      Comment


      • #4
        This is really not a bug or any problem caused by Stata or rcall. The problem is:

        1. The working directory you are using is restricted! You can right-click on the directory and select "Properties" (see attached photo) which show you the permission of your directory. But at least it is clear now that you have tried installing the package in a working directory that is not granting you writing permission. You can change the working directory to a new folder in "Documents", for instance. Read (help cd)... try this:

        Code:
        mkdir "C:\YOURUSERNAME\Documents\newfolder"
        cd "C:\YOURUSERNAME\Documents\newfolder"
        In the screenshot below, the Stata 16 directory is "read-only", meaning you can open the files that are in the directory but you cannot write new files in this directory.

        Click image for larger version

Name:	Screen Shot 2021-09-20 at 12.49.44.png
Views:	1
Size:	65.1 KB
ID:	1628188


        2. If you use rcall in a directory that does not grant you writing files - naturally - rcall will fail to communicate data between R and Stata. So again, this is the problem that you need to take care of for working with any program that needs writing permission.

        3. You seem to have installed rcall and configured R correctly now.
        ——————————————
        E. F. Haghish, IMBI, University of Freiburg
        [email protected]
        http://www.haghish.com/

        Comment


        • #5
          I will update the packages to give a clear error in this regard. But try creating a log file in Stata! You will receive the exact same error because Stata cannot create a log file in the directory you were using.
          ——————————————
          E. F. Haghish, IMBI, University of Freiburg
          [email protected]
          http://www.haghish.com/

          Comment


          • #6
            Dear Haghish,
            Thanks a lot, I am able to install the program after changing the directory.

            Thank you again
            Arup
            Attached Files

            Comment

            Working...
            X