Announcement

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

  • Accessing macros stored in c returned values

    I work in an office where some users work on OSX and others work on Windows, but we will tend to use networked disc space to store data. Other than storing additional local macros, does anyone have any ideas about how to access things like `c(os)' from Mata?

  • #2
    Mata has a function c() that returns the c-class values by name:

    Code:
    . mata: c("os")
    Windows

    Comment


    • #3
      German Rodriguez Thanks. I had been looking in the st_* functions but didn’t see it. Alan Riley (StataCorp) would it make sense to have an st_c() wrapper around c() to add a bit more consistency to the way these results get access from Mata?

      Comment


      • #4
        I also had trouble finding them. Turns out they are in st_* but as global macros:
        Code:
        . mata st_global("c(os)")
          Windows
        Later I discovered c(), which once you know about it is simpler.

        Comment


        • #5
          Interesting. I was trying to use st_local() without any luck assuming that the normal reference in Stata `c(os)' would mean it was possible to reference it as a local.

          Comment

          Working...
          X