[OGRUG] Is anyone running R on a Mac, and if so, can they let me know what the Sys.info() command returns?

Robert Biddle robtbiddle at gmail.com
Mon Aug 23 14:10:37 CEST 2010


  > Sys.info()["sysname"]
  sysname
"Darwin"

Is that what you need?
Robert

On 10-08-21 10:25 PM, David Gattrell wrote:
> I'm sending a command to open a PDF file from within an R script.  The
> actual command
> is system dependent, and I'm trying to figure out how I determine the script
> is running on
> a Mac, so that the correct command is used.  I don't have a Mac available to
> verify this
> section of the code.
>
>      help_button<- tkbutton(my_main_win,
>                          text="PDF Manual",
>                          anchor="w",
>                          command=function() {
>                              my_dir = getwd()
>                              src_dir<-
> paste(tclObj(Source_dir),sep="",collapse=" ")
>                              setwd(src_dir)
>                              # "RADAR_documentation_0v6p5.pdf"
>                              if
> (as.character(Sys.info()["sysname"])=="Windows") {
>                                  command_str = "cmd /c start
> RADAR_documentation_0v6p5.pdf"
>                              } else if
> (as.character(Sys.info()["sysname"])=="Mac") {
>                                  command_str = "open
> RADAR_documentation_0v6p5.pdf"
>                              } else { # linux
>                                  command_str = "xdg-open
> RADAR_documentation_0v6p5.pdf"
>                              }
>                              system(command_str)
>                              setwd(my_dir)
>                          })
>      tkpack(help_button,side="top",padx="10m",fill="x")
>
>
> Hopefully I'm sending this to the appropriate email address.
>
> Thanks,
>
> DaveG
>
>
> PS
>
> If you are curious as to what RADAR is in the above code...
> http://sites.google.com/site/stdfradar/
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-UG-Ottawa mailing list
> R-UG-Ottawa at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-ug-ottawa
>



More information about the R-UG-Ottawa mailing list