Re: [R] gfortran command not found?

2009-06-12 Thread chaogai
Hi Alon,

It works for me.
According to YAST I got libgfortran4.3, gcc-43fortran and gcc-fortran
installed

Kees
Marc Schwartz wrote:
> On Jun 11, 2009, at 12:34 PM, Alon Ben-Ari wrote:
>
>> Hello, I have openSUSE 11.1
>> Trying to install randomForest
>> as SU after invoking R install.packages("randomForest")
>>
>> and I get this
>>
>> * Installing *source* package ‘randomForest’ ...
>> ** libs
>> gcc -std=gnu99 -I/usr/lib/R/include -I/usr/local/include -fpic -O2 -c
>> classTree.c -o classTree.o
>> gcc -std=gnu99 -I/usr/lib/R/include -I/usr/local/include -fpic -O2 -c
>> regTree.c -o regTree.o
>> gcc -std=gnu99 -I/usr/lib/R/include -I/usr/local/include -fpic -O2 -c
>> regrf.c -o regrf.o
>> gcc -std=gnu99 -I/usr/lib/R/include -I/usr/local/include -fpic -O2 -c
>> rf.c -o rf.o
>> gfortran -fpic -O2 -c rfsub.f -o rfsub.o
>> make: gfortran: Command not found
>> make: *** [rfsub.o] Error 127
>> ERROR: compilation failed for package ‘randomForest’
>> * Removing ‘/usr/lib/R/library/randomForest’
>>
>> The downloaded packages are in
>> ‘/tmp/RtmpLEyfgR/downloaded_packages’
>> Updating HTML index of packages in '.Library'
>> Warning message:
>> In install.packages("randomForest") :
>> installation of package 'randomForest' had non-zero exit status
>>>
>>
>>
>> I checked that I have th fortran library
>>
>> S | Name | Summary | Type
>> --+---+--+
>> i | libgfortran41 | The GNU Fortran Compiler Runtime Library | package
>> i | libgfortran43 | The GNU Fortran Compiler Runtime Library | package
>>
>> Any ideas how to solve this impass?
>
>
>
> I have not worked on SUSE, but check to see where gfortran is located:
>
> $ which gfortran
>
> and be sure that it returns the path to the executable and that the
> path to it is in your $PATH.
>
> You might also want to review:
>
> http://cran.r-project.org/doc/manuals/R-admin.html#Using-FORTRAN
>
> HTH,
>
> Marc Schwartz
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Interaction term not significant when using glm???

2009-03-07 Thread chaogai
I think the interaction is not so strong anymore if you do what glm
does: use a logit transformation.
testdata <-
matrix(c(rep(0:1,times=4),rep(c("FLC","FLC","free","free"),times=2),
  rep(c("no","yes"),each =4),3,42,1,44,27,20,3,42),ncol=4)
colnames(testdata) <-c("spot","constr","vernalized","Freq")
testdata <- as.data.frame(testdata)
testdata$Freq <- as.numeric(as.character(testdata$Freq))
testdata$spot <- as.numeric(as.character(testdata$spot))

T2 <-
reshape(testdata,v.names='Freq',timevar='spot',idvar=names(testdata)[c(2,3)],direction='wide')
T2$Prop <- T2$Freq.0/(T2$Freq.0+T2$Freq.1)
plot(log(T2$Prop/(1-T2$Prop)),x=interaction(T2$constr,T2$vernalized))

Kees

joris meys wrote:
> Dear all,
>
> I have a dataset where the interaction is more than obvious, but I was asked
> to give a p-value, so I ran a logistic regression using glm. Very funny, in
> the outcome the interaction term is NOT significant, although that's
> completely counterintuitive. There are 3 variables : spot (binary response),
> constr (gene construct) and vernalized (growth conditions). Only for the FLC
> construct after vernalization, the chance on spots should be lower. So in
> the model one would suspect the interaction term to be significant.
>
> Yet, only the two main terms are significant here. Can it be my data is too
> sparse to use these models? Am I using the wrong method?
>
> # data generation
> testdata <-
> matrix(c(rep(0:1,times=4),rep(c("FLC","FLC","free","free"),times=2),
>   rep(c("no","yes"),each =4),3,42,1,44,27,20,3,42),ncol=4)
> colnames(testdata) <-c("spot","constr","vernalized","Freq")
> testdata <- as.data.frame(testdata)
>
> # model
> T0fit <- glm(spot~constr*vernalized, weights=Freq, data=testdata,
> family="binomial")
> anova(T0fit)
>
> Kind regards
> Joris
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R on netbooks et al?

2009-03-07 Thread chaogai
Johannes Huesing wrote:
> chaogai  [Thu, Mar 05, 2009 at 07:04:19PM CET]:
>   
>> I'm having similar experiences on my Acer Aspire One. Everything will
>> work good. Only thing that takes a lot of time is compiling R if you are
>> in the habit of doing so.
>>
>> 
>
> On the Fedora version that came with my Acer Aspire One, I am even thinking of
> compiling R itself as the current R version is 2.6.0 ...
>
> Otherwise, everything seems fine and the keyboard is indeed the greatest
> letdown so far (the tiny left mouse button a close second).
>
>
>   
I did do that. Most practical is to get the R-devel from the
repositories. It is the wrong version, will bring what you need to build
regarding other dependencies. Then remove R-devel and you can get your
2.8.1 sources from CRAN.
Not sure about the exact names of the things. Now happy on Suse 11.1
after a brief fling with the Fedora 10.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R on netbooks et al?

2009-03-05 Thread chaogai
I'm having similar experiences on my Acer Aspire One. Everything will
work good. Only thing that takes a lot of time is compiling R if you are
in the habit of doing so.



herrdittm...@yahoo.co.uk wrote:
> Dear useRs,
>
> With the rise of netbooks and 'lifestyle laptops" I am tempted to get one of 
> these to mainly run R on it. Processor power and hard disk space seem to be 
> ok. What I wonder is the handling and feel with respect to R.
>
> Has anyone here installed or is running R on one of these, and if so, what is 
> your experience? Would it be more of a nice looking gadget than a feasable 
> platform to do some stats on?
>
> Many thanks,
>
> Bernd
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl persp3d bounding box color problem.

2009-03-03 Thread chaogai
rgl_0.83-3  did not help

Duncan Murdoch wrote:
> On 3/2/2009 2:48 PM, chaogai wrote:
>> Oops, sorry
>>
>> R version 2.8.1 (2008-12-22)
>> i686-pc-linux-gnu
>>
>> locale:
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>>
>> attached base packages:
>> [1] tcltk stats graphics  grDevices utils datasets  methods
>> [8] base
>>
>> other attached packages:
>> [1] rgl_0.81svGUI_0.9-44svSocket_0.9-43 svMisc_0.9-46
>
> 0.81 isn't the current version of rgl on CRAN.  Please try that one,
> or even better, the development version on R-forge.
>
> Duncan Murdoch
>>
>>
>> Duncan Murdoch wrote:
>>> On 3/2/2009 2:00 PM, chaogai wrote:
>>>> Whatever it is, it is also happening on my Acer,  Suse 11.1, 32 bits,
>>>> self build R.
>>>
>>> Versions of R and rgl?
>>>
>>> Duncan Murdoch
>>>
>>>>
>>>> Kees
>>>>
>>>> Bo Zhou wrote:
>>>>> Thanks Duncan.
>>>>>
>>>>> I haven't got a chance to try it in windows yet. But I won't be
>>>>> surprised if it's my driver's fault. I had OpenGL problems on this
>>>>> dell laptop before.
>>>>>
>>>>>  
>>>>>> Date: Sun, 1 Mar 2009 18:29:20 -0500
>>>>>> From: murd...@stats.uwo.ca
>>>>>> To: bozhou1...@hotmail.com
>>>>>> CC: remkoduur...@gmail.com; r-help@r-project.org
>>>>>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>>>>>
>>>>>> On 01/03/2009 5:54 PM, Bo Zhou wrote:
>>>>>>   
>>>>>>> site down..
>>>>>>>
>>>>>>> here is the code
>>>>>>>
>>>>>>> library(rgl)
>>>>>>>
>>>>>>> plot1:
>>>>>>> persp3d(x=1:11,y=1:210,z=matrix(rep(1,11*210),11,210),col=matrix(rep("#FF",11*210),11,210))
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> plot2:
>>>>>>> persp3d(x=1:11,y=1:10,z=matrix(rep(1,11*10),11,10),col=matrix(rep("#FF",11*10),11,10))
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>> Works fine on Mac OS 10.5 too.  Looks like a bug in your OpenGL
>>>>>> driver...
>>>>>>
>>>>>> Duncan Murdoch
>>>>>>
>>>>>>
>>>>>>   
>>>>>>> Thanks!
>>>>>>>
>>>>>>> Bo
>>>>>>> 
>>>>>>>> Date: Mon, 2 Mar 2009 09:28:31 +1100
>>>>>>>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>>>>>>> From: remkoduur...@gmail.com
>>>>>>>> To: bozhou1...@hotmail.com
>>>>>>>>
>>>>>>>> I would not mind trying, but the link no longer works...
>>>>>>>>
>>>>>>>> Remko
>>>>>>>>
>>>>>>>>
>>>>>>>> -
>>>>>>>> Remko Duursma
>>>>>>>> Post-Doctoral Fellow
>>>>>>>>
>>>>>>>> Centre for Plant and Food Science
>>>>>>>> University of Western Sydney
>>>>>>>> Hawkesbury Campus
>>>>>>>> Richmond NSW 2753
>>>>>>>>
>>>>>>>> Dept of Biological Science
>>>>>>>> Macquarie University
>>>>>>>> North Ryde NSW 2109
>>>>>>>> Australia
>>>>>>>>
>>>>>>>> Mobile: +61 (0)422 096908
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Mar 2, 2009 at 8:16 AM, Bo Zhou 
>>>>>>>> wrote:
>>>>>>>>   
>>>>>>>>> Thanks, Duncan.
>>>>>>>>>
>>>>>>>>> What's your platform? Could this be an issues related to my
>>>>>

Re: [R] rgl persp3d bounding box color problem.

2009-03-02 Thread chaogai
Oops, sorry

R version 2.8.1 (2008-12-22)
i686-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] tcltk stats graphics  grDevices utils datasets  methods
[8] base

other attached packages:
[1] rgl_0.81svGUI_0.9-44svSocket_0.9-43 svMisc_0.9-46


Duncan Murdoch wrote:
> On 3/2/2009 2:00 PM, chaogai wrote:
>> Whatever it is, it is also happening on my Acer,  Suse 11.1, 32 bits,
>> self build R.
>
> Versions of R and rgl?
>
> Duncan Murdoch
>
>>
>> Kees
>>
>> Bo Zhou wrote:
>>> Thanks Duncan.
>>>
>>> I haven't got a chance to try it in windows yet. But I won't be
>>> surprised if it's my driver's fault. I had OpenGL problems on this
>>> dell laptop before.
>>>
>>>  
>>>> Date: Sun, 1 Mar 2009 18:29:20 -0500
>>>> From: murd...@stats.uwo.ca
>>>> To: bozhou1...@hotmail.com
>>>> CC: remkoduur...@gmail.com; r-help@r-project.org
>>>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>>>
>>>> On 01/03/2009 5:54 PM, Bo Zhou wrote:
>>>>
>>>>> site down..
>>>>>
>>>>> here is the code
>>>>>
>>>>> library(rgl)
>>>>>
>>>>> plot1:
>>>>> persp3d(x=1:11,y=1:210,z=matrix(rep(1,11*210),11,210),col=matrix(rep("#FF",11*210),11,210))
>>>>>
>>>>>
>>>>> plot2:
>>>>> persp3d(x=1:11,y=1:10,z=matrix(rep(1,11*10),11,10),col=matrix(rep("#FF",11*10),11,10))
>>>>>
>>>>>   
>>>> Works fine on Mac OS 10.5 too.  Looks like a bug in your OpenGL
>>>> driver...
>>>>
>>>> Duncan Murdoch
>>>>
>>>>
>>>>
>>>>> Thanks!
>>>>>
>>>>> Bo
>>>>>  
>>>>>> Date: Mon, 2 Mar 2009 09:28:31 +1100
>>>>>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>>>>> From: remkoduur...@gmail.com
>>>>>> To: bozhou1...@hotmail.com
>>>>>>
>>>>>> I would not mind trying, but the link no longer works...
>>>>>>
>>>>>> Remko
>>>>>>
>>>>>>
>>>>>> -
>>>>>> Remko Duursma
>>>>>> Post-Doctoral Fellow
>>>>>>
>>>>>> Centre for Plant and Food Science
>>>>>> University of Western Sydney
>>>>>> Hawkesbury Campus
>>>>>> Richmond NSW 2753
>>>>>>
>>>>>> Dept of Biological Science
>>>>>> Macquarie University
>>>>>> North Ryde NSW 2109
>>>>>> Australia
>>>>>>
>>>>>> Mobile: +61 (0)422 096908
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Mar 2, 2009 at 8:16 AM, Bo Zhou 
>>>>>> wrote:
>>>>>>
>>>>>>> Thanks, Duncan.
>>>>>>>
>>>>>>> What's your platform? Could this be an issues related to my
>>>>>>> platform? I'm on Ubuntu 8.10 64bit using cran's R package. I
>>>>>>> built rgl package on my machine using install.packages(). I'm
>>>>>>> going to give it a try in windows.
>>>>>>>
>>>>>>> I would be very grateful if anyone using similar setup could
>>>>>>> give it a try.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Bo
>>>>>>>
>>>>>>>  
>>>>>>>> Date: Sun, 1 Mar 2009 07:03:10 -0500
>>>>>>>> From: murd...@stats.uwo.ca
>>>>>>>> To: bozhou1...@hotmail.com
>>>>>>>> CC: r-help@r-project.org
>>>>>>>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>>>>>>>
>>>>>>>> On 28/02/2009 4:20 PM, Bo Zhou wrote:
>>>>>>>>
>>>>>>>>> Hi guys,
>>>>>>>>>
>>>>>

Re: [R] rgl persp3d bounding box color problem.

2009-03-02 Thread chaogai
Whatever it is, it is also happening on my Acer,  Suse 11.1, 32 bits,
self build R.

Kees

Bo Zhou wrote:
> Thanks Duncan.
>
> I haven't got a chance to try it in windows yet. But I won't be surprised if 
> it's my driver's fault. I had OpenGL problems on this dell laptop before.
>
>   
>> Date: Sun, 1 Mar 2009 18:29:20 -0500
>> From: murd...@stats.uwo.ca
>> To: bozhou1...@hotmail.com
>> CC: remkoduur...@gmail.com; r-help@r-project.org
>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>
>> On 01/03/2009 5:54 PM, Bo Zhou wrote:
>> 
>>> site down..
>>>
>>> here is the code
>>>
>>> library(rgl)
>>>
>>> plot1:
>>> persp3d(x=1:11,y=1:210,z=matrix(rep(1,11*210),11,210),col=matrix(rep("#FF",11*210),11,210))
>>>
>>> plot2:
>>> persp3d(x=1:11,y=1:10,z=matrix(rep(1,11*10),11,10),col=matrix(rep("#FF",11*10),11,10))
>>>   
>> Works fine on Mac OS 10.5 too.  Looks like a bug in your OpenGL driver...
>>
>> Duncan Murdoch
>>
>>
>> 
>>> Thanks!
>>>
>>> Bo
>>>   
 Date: Mon, 2 Mar 2009 09:28:31 +1100
 Subject: Re: [R] rgl persp3d bounding box color problem.
 From: remkoduur...@gmail.com
 To: bozhou1...@hotmail.com

 I would not mind trying, but the link no longer works...

 Remko


 -
 Remko Duursma
 Post-Doctoral Fellow

 Centre for Plant and Food Science
 University of Western Sydney
 Hawkesbury Campus
 Richmond NSW 2753

 Dept of Biological Science
 Macquarie University
 North Ryde NSW 2109
 Australia

 Mobile: +61 (0)422 096908



 On Mon, Mar 2, 2009 at 8:16 AM, Bo Zhou  wrote:
 
> Thanks, Duncan.
>
> What's your platform? Could this be an issues related to my platform? I'm 
> on Ubuntu 8.10 64bit using cran's R package. I built rgl package on my 
> machine using install.packages(). I'm going to give it a try in windows.
>
> I would be very grateful if anyone using similar setup could give it a 
> try.
>
> Thanks,
> Bo
>
>   
>> Date: Sun, 1 Mar 2009 07:03:10 -0500
>> From: murd...@stats.uwo.ca
>> To: bozhou1...@hotmail.com
>> CC: r-help@r-project.org
>> Subject: Re: [R] rgl persp3d bounding box color problem.
>>
>> On 28/02/2009 4:20 PM, Bo Zhou wrote:
>> 
>>> Hi guys,
>>>
>>> I hit on a problem when I use rgl.
>>>
>>> Could you try to run the code here in this link and see why the first 
>>> persp3d gives a red bounding box and the second shows black?
>>>   
>> They both show as black on my system.
>>
>> Duncan Murdoch
>>
>> 
>>> http://rafb.net/p/g1i7ur33.html
>>>
>>> (sorry for not pasting the code here directly but my previous email got 
>>> filtered by this list so I suspect my code looks like spam to the spam 
>>> filter)
>>>
>>> I'm expecting black color to be the right result but the code is 
>>> virtually same except different data size. Looks like a mem bug to me?
>>>
>>>
>>> BTW you will need to install the rgl package
>>>
>>> Thanks,
>>>
>>> Bo
>>>
>>> _
>>>
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide 
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>   
> _
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>   
>>> _
>>>
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>   
>
> _
> Hotmail® is up to 70% faster. Now good news travels really fast. 
>
>   [[alternative HTML version deleted]]
>
>   
> 
>
> __
> R-help@r-project.org mailing list

Re: [R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009

2009-02-19 Thread chaogai

I do not know about the ubuntu instructions, they would not help me on
Suse. The wine version is 1.1.9.
I thought that was the latest,but when I checked latest is 1.1.15, which
does indeed throw the blackbox error.
So, now it does not work for me either
Sorry I gave bad advise

kees

On Thu, 19 Feb 2009 01:38:15 +0100, Paul Heinrich Dietrich
 wrote:



I went to this webpage (http://ubuntuforums.org/showthread.php?t=624644)  
and

followed the instructions to the letter on getting the latest Wine.  I
installed WinBUGS again, but this time I cannot open it in Wine.  It says
Black Box, Trap #101, and some text I can't copy/paste here.  Is this the
latest Wine that you have, or something different?  Thanks.


chaogai-2 wrote:


Hi,

For me running winbugs through wine just works. Even when I do not  
specify

any directories.
The example they give in the bugs helpfile was my starting point.
Setup is suse 11.1, latest Wine, R, R2WinBUGS & winbugs.
I assume you first tried without specifying directories?
The directories you use do not work for me, with WINEPATH the culprit.
If you do not have the latest wine I advise to upgrade & not specify
directories.

Good luck,
Kees

On Wed, 18 Feb 2009 01:27:18 +0100, Paul Heinrich Dietrich
 wrote:



Hi Uwe,
Thank you for your guidance.  I have installed R2WinBUGS and WinBUGS14
under
wine.  Using ?bugs for help, it tells me:

useWINE: logical; attempt to use the Wine emulator to run 'WinBUGS',
defaults to 'FALSE' on Windows, and 'TRUE' otherwise. Not available in
S-PLUS.

WINE: character, path to 'wine' binary file, it is tried hard (by a  
guess

and the utilities 'which' and 'locate')  to get the information
automatically if not given.

newWINE: Use new versions of Wine that have 'winepath' utility

WINEPATH: character, path to 'winepath' binary file, it is tried hard
(by a
guess and the utilities 'which' and 'locate')  to get the information
automatically if not given.

..and the following code is a simple Bayesian version of a t-test...

  Directory Paths

MyModelPath <- "/home/me/Compound/R/WinBUGS/"
MyBUGSPath <- "/home/me/.wine/drive_c/Program Files/WinBUGS14/"
MyModelFile <- paste(MyModelPath, "model.bug", sep="")
WINEPATH <- "/usr/bin/wine"

  Create Data Set

# Here is some fake data
n_draws <- 50
x <- round(runif(n_draws, 1, 2))
y <- ifelse(x == 1, rnorm(n_draws, 1, 1), rnorm(n_draws, 1.2, 0.8))
MyData <- as.data.frame(cbind(y, x))
y.n <- NROW(MyData$y)
x.j <- length(unique(x))
summary(MyData)

##  Format Data for WinBUGS
##
MyBUGSData <- list(y=MyData$y, x=MyData$x, n=y.n, x.j=x.j)
MyBUGSData

##  WinBUGS Model File
###
library(R2WinBUGS)
cat("model
{
for (i in 1:n)
{
y[i] ~ dnorm(mu[i], tau)
mu[i] <- alpha + beta[x[i]]
}
### STZ (Sum-To-Zero) Constraints
beta[1] <- -sum(beta[2:x.j])
### Priors
alpha ~ dnorm(0.0, 1.0E-4)
for (i in 2:x.j)
{
beta[i] ~ dnorm(0.0, 1.0E-4)
}
tau ~ dgamma(0.01, 0.01)
precision <- sqrt(1/tau)
}",
file=MyModelFile)
file.show(MyModelFile)

#  WinBUGS Model
#
MyModel <- bugs(MyBUGSData, inits=NULL,
model.file=MyModelFile,
parameters.to.save=c("alpha", "beta", "precision"),
n.chains=3, n.iter=2000, n.burnin=1000, n.thin=1, codaPkg=TRUE,
bugs.directory = MyBUGSPath, working.directory=MyModelPath,
useWINE=TRUE, WINEPATH=WINEPATH, debug=TRUE)

The output says:

ERROR:
  cannot open the connection

I'm wondering if I've misinterpreted how to set my paths with wine,
because
I can go to the following path, double-click on WinBUGS14.exe, and open
it
just fine: /home/me/.wine/drive_c/Program Files/WinBUGS14/

I can also go to Applications > Wine > Browse C:\ Drive and navigate to
WinBUGS.

Please help if I've done something wrong.  Thanks.




--

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.








--

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009

2009-02-18 Thread chaogai

Hi,

For me running winbugs through wine just works. Even when I do not specify  
any directories.

The example they give in the bugs helpfile was my starting point.
Setup is suse 11.1, latest Wine, R, R2WinBUGS & winbugs.
I assume you first tried without specifying directories?
The directories you use do not work for me, with WINEPATH the culprit.
If you do not have the latest wine I advise to upgrade & not specify  
directories.


Good luck,
Kees

On Wed, 18 Feb 2009 01:27:18 +0100, Paul Heinrich Dietrich  
 wrote:




Hi Uwe,
Thank you for your guidance.  I have installed R2WinBUGS and WinBUGS14  
under

wine.  Using ?bugs for help, it tells me:

useWINE: logical; attempt to use the Wine emulator to run 'WinBUGS',
defaults to 'FALSE' on Windows, and 'TRUE' otherwise. Not available in
S-PLUS.

WINE: character, path to 'wine' binary file, it is tried hard (by a guess
and the utilities 'which' and 'locate')  to get the information
automatically if not given.

newWINE: Use new versions of Wine that have 'winepath' utility

WINEPATH: character, path to 'winepath' binary file, it is tried hard  
(by a

guess and the utilities 'which' and 'locate')  to get the information
automatically if not given.

..and the following code is a simple Bayesian version of a t-test...

  Directory Paths   


MyModelPath <- "/home/me/Compound/R/WinBUGS/"
MyBUGSPath <- "/home/me/.wine/drive_c/Program Files/WinBUGS14/"
MyModelFile <- paste(MyModelPath, "model.bug", sep="")
WINEPATH <- "/usr/bin/wine"

  Create Data Set   


# Here is some fake data
n_draws <- 50
x <- round(runif(n_draws, 1, 2))
y <- ifelse(x == 1, rnorm(n_draws, 1, 1), rnorm(n_draws, 1.2, 0.8))
MyData <- as.data.frame(cbind(y, x))
y.n <- NROW(MyData$y)
x.j <- length(unique(x))
summary(MyData)

##  Format Data for WinBUGS   
##

MyBUGSData <- list(y=MyData$y, x=MyData$x, n=y.n, x.j=x.j)
MyBUGSData

##  WinBUGS Model File   
###

library(R2WinBUGS)
cat("model
{
for (i in 1:n)
{
y[i] ~ dnorm(mu[i], tau)
mu[i] <- alpha + beta[x[i]]
}
### STZ (Sum-To-Zero) Constraints
beta[1] <- -sum(beta[2:x.j])
### Priors
alpha ~ dnorm(0.0, 1.0E-4)
for (i in 2:x.j)
{
beta[i] ~ dnorm(0.0, 1.0E-4)
}
tau ~ dgamma(0.01, 0.01)
precision <- sqrt(1/tau)
}",
file=MyModelFile)
file.show(MyModelFile)

#  WinBUGS Model   
#

MyModel <- bugs(MyBUGSData, inits=NULL,
model.file=MyModelFile,
parameters.to.save=c("alpha", "beta", "precision"),
n.chains=3, n.iter=2000, n.burnin=1000, n.thin=1, codaPkg=TRUE,
bugs.directory = MyBUGSPath, working.directory=MyModelPath,
useWINE=TRUE, WINEPATH=WINEPATH, debug=TRUE)

The output says:

ERROR:
  cannot open the connection

I'm wondering if I've misinterpreted how to set my paths with wine,  
because
I can go to the following path, double-click on WinBUGS14.exe, and open  
it

just fine: /home/me/.wine/drive_c/Program Files/WinBUGS14/

I can also go to Applications > Wine > Browse C:\ Drive and navigate to
WinBUGS.

Please help if I've done something wrong.  Thanks.




--

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] surprising predicting capabilities

2008-06-03 Thread chaogai
Hi,

I noticed the following fortune in R 2.7 and 2.6.2:

fortune('Spreads')

If anything, there should be a Law: Thou Shalt Not Even Think Of Producing A
Graph That Looks Like Anything From A Spreadsheet.
   -- Ted Harding (in a discussion about producing graphics)
  R-help (August 2008)


Just wondering, what function and library gave this detailed prediction?

Cheers

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Windows Vista 64-bit support

2008-03-17 Thread chaogai
The standard windows build works in Vista 64. 
A 64 bits build depends on tools outside the realm of the R-core team; a 64 
bits compiler

On Monday 17 March 2008 06:17:31 pm Daniel Gatti wrote:
> Where does the R build for Vista X64 stand?  The last update message is
> from July last year (see [R] Improved Windows Vista compatibility from
> Prof Brian Ripley on 2007-07-11).  Is it likely to happen in 2008?  I
> suspect that more people will start using it as Vista is adopted more
> widely.  And I'd certainly use it for large genomics data sets.
>
> Thanks,
> Dan Gatti
> UNC-CH
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented, minimal,
> self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] best text editor for Linux?

2008-02-02 Thread chaogai
After to much windows contamination, my brain does not do the cryptic part of 
Emacs+ESS C-x M-c M-headache. Eclipse is is currently my choice.
(But the installation instructions could be better)

Kees


On Saturday 02 February 2008 05:49:10 am 宋时歌 wrote:
> On Linux platform, nothing beats Emacs + ESS.
>
> Shige
>
> On Feb 2, 2008 11:06 AM, Wade Wall <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I know this question has been asked in the past, but I am wondering if
> > anyone running R on Linux has any guidance as to a text editor that works
> > well with R.  At the present time I am running R on Windows and using
> > TINN-R.  For a number of reasons I want to switch to Linux, but can't
> > find much in the way of a text editor in sync with R.  Any experiences,
> > recommendations would be appreciated.
> >
> > Wade Wall
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented, minimal,
> self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.