From: Gregor G. <gre...@bf...> - 2007-09-18 09:19:01
|
Hi! Sparapani, Rodney wrote: >>> Sys.setenv(DISPLAY=":0.0") >>> schools.sim <- bugs (data=data, >> + inits=inits, >> + parameters.to.save=parameters, >> + model.file="schools.txt", >> + n.chains=3, >> + n.iter=1000, >> + bugs.directory="/Applications/WinBUGS14", >> + debug=FALSE) >> > Doesn't work: > > sh: line 1: no: command not found ... > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : > scan() expected 'a real', got 'WinBUGS' WINE and WINEPATH arguments can be NULL and findUnixBinary() in R/wineutils tries to find corresponding binaries. Can you copy the following (slightly modified findUnixBinary()) into your R. I would like to know which command has not been found on mac, is it either which or locate. findUnixBinary <- function(x) { ## --- Environmental variable --- cat("env\n") tmp <- Sys.getenv(toupper(x)) if(nchar(tmp) != 0) return(tmp) ## else ## --- Standard place --- cat("/usr/bin\n") tmp <- paste("/usr/bin", x, sep="") if(file.exists(tmp)) return(tmp) ## else ... ## --- Which --- cat("which\n") tmp <- system(paste("which ", x, sep=""), intern=TRUE) if(length(tmp) != 0) return(tmp) ## else .. ## --- Locate --- cat("locate\n") tmp <- system(paste("locate ", x, " | grep bin/", x, "$", sep=""), intern=TRUE) tmp <- tmp[length(tmp)] ## keep only last hit if(length(tmp) > 0) return(tmp) stop(paste("couldn't find", x, "binary file")) } findUnixBinary(x="wine") findUnixBinary(x="winepath") > And you are correct. /Applications is the standard place to install GUI applications > such as R. Command-line only applications can be installed anywhere. How do you install WinBUGS on Mac? Do you choose /Aplications folder or ... I just want to be sure that /Applications is a safe default as C:\Program Files is on MS Windows. Additionally, how can we know if R is running on Mac? I guess that .Platform$OS.type has value "unix" as for Linux/Unix. -- Lep pozdrav / With regards, Gregor Gorjanc ---------------------------------------------------------------------- University of Ljubljana PhD student Biotechnical Faculty www: http://www.bfro.uni-lj.si/MR/ggorjan Zootechnical Department blog: http://ggorjan.blogspot.com Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si SI-1230 Domzale fax: +386 (0)1 72 17 888 Slovenia, Europe tel: +386 (0)1 72 17 861 ---------------------------------------------------------------------- |