Announcement

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

  • #46
    Thanks. You are right:

    Code:
    . findfile Rpath.ado
    file "Rpath.ado" not found
    r(601);
    (To be certain, I also checked "findfile rpath.ado")

    Comment


    • #47
      Ok. I think I found the problem. version 1.5.1 should work fine, hopefully.

      However, the installation command you specified has changed because it is clear that it was breaking the Stata toc file. that is why I created a new command to make installation from GitHub safer. read the documentation on github and reinstall your Rcall. I hope it solves the problem.

      https://github.com/haghish/Rcall

      if you intend to use Rcall often, you can "watch" the repository, to subscribe to the recent developments of the package.
      ——————————————
      E. F. Haghish, IMBI, University of Freiburg
      [email protected]
      http://www.haghish.com/

      Comment


      • #48
        Installation (Github) does not work:

        Code:
        .  net install Rcall, replace from("https://raw.githubusercontent.com/haghish/Rcall/master/")
        checking Rcall consistency and verifying not already installed...
        file https://raw.githubusercontent.com/haghish/Rcall/master/stata.output.r not found
        could not copy https://raw.githubusercontent.com/haghish/Rcall/master/stata.output.r
        (no action taken)
        r(601);
        Also:

        Code:
        . github install haghish/Rcall
        checking Rcall consistency and verifying not already installed...
        file https://raw.githubusercontent.com/haghish/rcall/master/stata.output.r not found
        could not copy https://raw.githubusercontent.com/haghish/rcall/master/stata.output.r
        (no action taken)
        r(601);

        Comment


        • #49
          yet another human error. try it now... it worked for me. also on Mac.
          ——————————————
          E. F. Haghish, IMBI, University of Freiburg
          [email protected]
          http://www.haghish.com/

          Comment


          • #50
            Great support, it took just one day to solve a fundamental problem. Impressed! Thanks a lot.

            Output from my Stata Results:

            Code:
            . Rcall setpath "/usr/local/bin/R"
            
            . R: 3+4
            [1] 7

            Comment


            • #51
              But speed seems to be an issue (unless I do something completely wrong).

              This took 55 seconds:

              Code:
              . Rcall
              ---------------------------------------------------- R (type end to exit) -------------------------------------------------------------------
              . a <- c(1,2,3)
              . a
              [1] 1 2 3

              Stata is overall extremely slow after this task.

              (iMac 3.2 GHz Intel Core i5; 32 GB RAM, of which 24 GB RAM were free. Rcall 1.5.1.)
              Last edited by sladmin; 11 Dec 2017, 10:50. Reason: anonymize poster

              Comment


              • #52
                55 seconds is hilarious. I remember there was another user - several months ago - reporting a very slow process. I have no idea why this should take so long.

                In general, working with Rcall is as fast as working with R + 40ms delay, which is for waking up R and its memory and transferring the objects back to Stata. Since you have no "bug" in running the code, it becomes mch more difficult for me to figure out what is going wrong.

                It seems you are using R interactively. I suggest trying it in "vanilla" mode, which is not interactive, to see if that works any faster. Try:

                Code:
                Rcall vanilla: a = c(1,2,3); a;
                ——————————————
                E. F. Haghish, IMBI, University of Freiburg
                [email protected]
                http://www.haghish.com/

                Comment


                • #53
                  Strange. Not only vanilla mode worked fast, as expected. Now even the interactive mode works reasonable fast with that simple command, about 1sec.

                  I'll explore further and report back if I can find anything more clear than Rcall randomly gettng very slow.
                  As fast as working with R plus 40ms delay sounds very promising!

                  Comment


                  • #54
                    well, remember that your best friend is:

                    Code:
                    Rcall clear
                    and your second best friend is "watching" the package on GitHub. I say that all the time because most of the bug reports I get via email are due to using old versions and not following the updates...

                    glad to hear it's working fine now. I still can't think of any reason why it should keep you waiting for 55 seconds at the first place. but in the interactive mode anything you type gets memorized, so Rcall clear can remove the session and start a fresh session.
                    ——————————————
                    E. F. Haghish, IMBI, University of Freiburg
                    [email protected]
                    http://www.haghish.com/

                    Comment


                    • #55
                      Dear Mr Hagish, thanks a lot for this great package!

                      The automatic detection of the path of R does not seem to work on my PC. I'm using Windows (8 and 10), and version 1.5.1 of Rcall.ado. The path of R is "C:/Program Files/R/R-3.3.2/bin/R.exe".

                      I think there is an issue with upper-/lowercase folder names in line 401 of Rcall.ado, i.e. when looking for a subfolder starting with "R-":
                      Code:
                      local Rdir : dir "`folder'" dirs "R-*"
                      The problem is that this macro function transforms all subdirectory names into lowercase letters, and then searches for a subdirectory starting with an uppercase R, hence it cannot find the subdirectory although it exists. To fix this, one could add the option "respectcase" to line 401, which forces the macro function to keep the original uppercase foldernames:
                      Code:
                      local Rdir : dir "`folder'" dirs "R-*", respectcase
                      The same issue also appears in R.ado

                      Comment


                      • #56
                        Thanks for this Florian. This code suggestion is "your" contribution. You could fork the repository, add this option and suggest me to change the code (and I will gladly accept your suggestion). Here is the link to the repository on GitHub https://github.com/haghish/Rcall.

                        If you are not into GitHub, I will take care of it on next updates. But still, it is much nicer to give the credits to the contributor and in GitHub it happens automatically. Either way, thatnks for the bug fix.
                        ——————————————
                        E. F. Haghish, IMBI, University of Freiburg
                        [email protected]
                        http://www.haghish.com/

                        Comment


                        • #57
                          Originally posted by haghish View Post
                          Thanks for this Florian. This code suggestion is "your" contribution. You could fork the repository, add this option and suggest me to change the code (and I will gladly accept your suggestion). Here is the link to the repository on GitHub https://github.com/haghish/Rcall.

                          If you are not into GitHub, I will take care of it on next updates. But still, it is much nicer to give the credits to the contributor and in GitHub it happens automatically. Either way, thatnks for the bug fix.
                          Report two problems1) setwd comment is invalid in Windows; (2) cannot read the dataset if the file path names contain non-English characters.

                          Comment


                          • #58
                            Patrick Fang
                            I have not seen R comments being claimed as a feature of Rcall. What I do is copy and paste any R comments into Stata as Stata comments. It should work on the latest versions of Rcall but I have no tested that. Here is an example which works for me with Rcall version 1.4.2 on Stata 14.2 for Windows.
                            Code:
                            capture program drop rprog1
                            program define rprog1
                            syntax
                            Rcall vanilla:  ///
                            setwd("F:/DOH");  /// cd
                            
                            end
                            rprog1
                            Normally you would have more lines of R code after setwd(). But the example code above illustrates a flexible workaround solution. I agree it would be nice if R comments could work directly in Rcall but I see it as a low priority. I cannot help with the second problem you report, and you should give an example if you need help.

                            Comment


                            • #59
                              I've just implemented my suggestion on GitHub. It was my first time using GitHub, so I hope that I did it in a correct way...

                              Comment

                              Working...
                              X