Announcement

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

  • #31
    The function for loading data from R to stata was renamed st.load
    Given you haven't noticed that, now also the readstata13 R package is required, instead of foreign (see the help file)
    Nevertheless, Rcall version 1.3.5 should work just fine with data communication. So reinstall it from GitHub
    ——————————————
    E. F. Haghish, IMBI, University of Freiburg
    [email protected]
    http://www.haghish.com/

    Comment


    • #32
      Thanks, I have no known problem with using Rcall version 1.3.5.

      I did not have readstata13 installed before. I still find load.data() in the documentation at http://www.haghish.com/packages/Rcall.php and at http://www.haghish.com/resources/pdf/Haghish_Rcall.pdf but I am behind a firewall, so sometimes I used outdated cached web pages.

      Comment


      • #33
        Glad to hear that.

        No you are right. I think I only changed the documentation in the Stata help file.

        ——————————————
        E. F. Haghish, IMBI, University of Freiburg
        [email protected]
        http://www.haghish.com/

        Comment


        • #34
          Originally posted by haghish View Post
          Glad to hear that.

          No you are right. I think I only changed the documentation in the Stata help file.
          A problem has not been fully solved is how to read data from online sources. For example,
          input:

          .(test <- read.table("http://www.ats.ucla.edu/stat/data/test.txt", header = TRUE))

          www.ats.ucla.edu\ invalid name
          r(198);

          Comment


          • #35
            I do not have this problem in the latest version. Please report your OS and Rcall version. I'm using Mac, Stata 14.1, Rcall 1.3.5

            Code:
            . Rcall clear
            (R memory cleared)
            
            . Rcall: (test <- read.table("http://www.ats.ucla.edu/stat/data/test.txt", header = TRUE))
               prgtype gender  id ses schtyp level
            1  general      0  70   4      1     1
            2   vocati      1 121   4      2     1
            3  general      0  86   4      3     1
            4   vocati      0 141   4      3     1
            5 academic      0 172   4      2     1
            6 academic      0 113   4      2     1
            7  general      0  50   3      2     1
            8 academic      0  11   1      2     1
            ——————————————
            E. F. Haghish, IMBI, University of Freiburg
            [email protected]
            http://www.haghish.com/

            Comment


            • #36
              Originally posted by haghish View Post
              I do not have this problem in the latest version. Please report your OS and Rcall version. I'm using Mac, Stata 14.1, Rcall 1.3.5

              Code:
              . Rcall clear
              (R memory cleared)
              
              . Rcall: (test <- read.table("http://www.ats.ucla.edu/stat/data/test.txt", header = TRUE))
              prgtype gender id ses schtyp level
              1 general 0 70 4 1 1
              2 vocati 1 121 4 2 1
              3 general 0 86 4 3 1
              4 vocati 0 141 4 3 1
              5 academic 0 172 4 2 1
              6 academic 0 113 4 2 1
              7 general 0 50 3 2 1
              8 academic 0 11 1 2 1
              I am using Win10, Stata 14.1, Rcall 1.3.5
              if I input:
              . Rcall: (test <- read.table("http://www.ats.ucla.edu/stat/data/test.txt", header = TRUE)) Rcall runs well

              prgtype gender id ses schtyp level
              1 general 0 70 4 1 1
              2 vocati 1 121 4 2 1
              3 general 0 86 4 3 1
              4 vocati 0 141 4 3 1
              5 academic 0 172 4 2 1
              6 academic 0 113 4 2 1
              7 general 0 50 3 2 1
              8 academic 0 11 1 2 1

              However, if I input:
              . Rcall:
              ---------------------------------------------------- R (type end to exit) -----------------------------
              . (test <- read.table("http://www.ats.ucla.edu/stat/data/test.txt", header = TRUE))
              www.ats.ucla.edu invalid name
              r(198);

              Comment


              • #37
                After I updated the program, the above mentioned issue disappears. Thanks for your excellent work, Dr. Haghish.

                Comment


                • #38
                  glad to hear that.
                  ——————————————
                  E. F. Haghish, IMBI, University of Freiburg
                  [email protected]
                  http://www.haghish.com/

                  Comment


                  • #39
                    This is just an update to note that the Rcall working paper is finished and accessible from http://www.haghish.com/resources/pdf/Haghish_Rcall.pdf
                    ——————————————
                    E. F. Haghish, IMBI, University of Freiburg
                    [email protected]
                    http://www.haghish.com/

                    Comment


                    • #40
                      Thanks for the great effort by developing Rcall!
                      I can't get Rcall to work. Here is my input and what I get if I try to get Rcall to use the correct path for R:

                      Code:
                      . Rcall setpath "/usr/local/bin/r"
                      R was expected in:  /usr/bin/r Rcall could not find R on your system
                      
                      invalid syntax
                      r(198);

                      I'm using Rcall version 1.4.3

                      Comment


                      • #41
                        What is the full path to your executable R? Which operating system do you use?

                        Comment


                        • #42
                          Using Terminal (on Mac) to ask Which R gives me the path used. I believe the path mentioned is typical for Mac OS?
                          I have tried the same path for rsource, and rsouce works fine after I defined the path mentioned.

                          I may be wrong, but I though that the example showed that Rcall does not register the path provided (adding /local/), and instead continues to expect R in the default location (default as defined by Rcall).
                          Last edited by sladmin; 11 Dec 2017, 10:49. Reason: anonymize poster

                          Comment


                          • #43
                            Which Mac OS do you have? Is it case-sensitive? You typed lowercase r
                            Code:
                            "/usr/local/bin/r"
                            whereas the Rcall documentation for Mac OS X states that the usual paths ends with uppercase R
                            Code:
                            /usr/bin/R
                            Therefore, double-check there is no typo. Better, show the output from the terminal just in case there is a typo. I cannot help more because I use Windows, not Mac OS. Haghish uses Mac OS. He typically wants (requires) you to test the latest version which is 1.5.0 so please do that.

                            Comment


                            • #44
                              Using the Terminal on Mac (Sierra) to find R gives:

                              Code:
                              GuestsiMac:~ Guest$ Which R
                              /usr/local/bin/R
                              GuestsiMac:~ Guest$
                              I have the latest version of Rcall that is provided with the following means of downloading:

                              Code:
                              net install Rcall, replace from("https://raw.githubusercontent.com/haghish/Rcall/master/")
                              The help file for Rcall says the version is 1.4.3. As previously stated, Rcall does not find R (3.3.2), it seems I am not able to change the location assumed by Rcall.

                              Code:
                              . Rcall setpath "/usr/local/bin/R"
                              R was expected in:  /usr/bin/r Rcall could not find R on your system
                              
                              invalid syntax
                              r(198);
                              It would be great if anyone sees the problem.
                              Last edited by sladmin; 11 Dec 2017, 10:50. Reason: anonymize poster

                              Comment


                              • #45
                                the rcall setpath creates an ado file in the PLUS directory which stores the R path. can you confirm that the file is created?

                                type:

                                Code:
                                findfile Rpath.ado
                                if it finds it, then try to execute the file:

                                Code:
                                Rpath
                                confirm if there was no error. then we can continue. this is rather weird. I can't think of any reason why Rcall fails to access R on your machine. this just means that the path you are defining - for some reasons - is not accessible by Rcall.





                                ——————————————
                                E. F. Haghish, IMBI, University of Freiburg
                                [email protected]
                                http://www.haghish.com/

                                Comment

                                Working...
                                X