Re: [R] Sweave

2010-08-18 Thread Randall Wrong
I am sorry, I don't get it :-( What's the "main body of the Sweave file" ? Randall 2010/8/18 Abhijit Dasgupta > No, the \setkeys statement should be in the main body of the Sweave file, > not in the R code part. > > On Aug 18, 2010 9:20 AM, "Randall

Re: [R] Sweave

2010-08-18 Thread Randall Wrong
n{center} > \setkeys{Gin}{width=0.7\textwidth} > \begin{Scode}{fig=T, echo=F} > ... > \end{Scode} > \end{center} > > Hope this helps. > > Karen > > On Wed 18Aug10, Randall Wrong wrote: > > Dear R users, > > > > I am using Sweave.

[R] Sweave

2010-08-17 Thread Randall Wrong
Dear R users, I am using Sweave. I would like to use the width option for the graphics : \begin{figure}[h!] \centering \includegraphics[width=0.7\textwidth]{x} \end{figure} How do I get this ? Thank you very much, Randall [[alternative HTML version deleted]] _

Re: [R] coda sweave

2010-04-29 Thread Randall Wrong
Thank you Bryan 2010/4/27 Brian Diggs > On 4/27/2010 1:42 PM, Randall Wrong wrote: > >> Thank you so much Ista. >> >> I have problems with pictures too. >> >> \begin{figure} >> \centering >> <>= >> xyplot( mcmc(x) ) >> @ >>

Re: [R] coda sweave

2010-04-27 Thread Randall Wrong
tics) > xtable(m1.sum$quantiles) > > Best, > Ista > > On Tue, Apr 27, 2010 at 12:22 PM, Randall Wrong > wrote: > > This is the kind of output I get with summary(mcmc(x)). I would like it > in > > LaTeX. There are two tables. > > > > Iterations = 1:10

Re: [R] coda sweave

2010-04-27 Thread Randall Wrong
-0.91681 -0.1798 0.7134 7.929 var2 -4.1454 -3.89975 -3.5207 -2.1781 7.706 var3 -2.0412 -0.79606 0.3247 1.0445 7.999 var4 -0.9809 -0.08847 0.1895 0.4980 8.015 Thank you very much for any help, Randall 2010/4/27 Randall Wrong > I forgot to say that the coda package is loaded. > > Randall

Re: [R] coda sweave

2010-04-27 Thread Randall Wrong
I forgot to say that the coda package is loaded. Randall 2010/4/27 Randall Wrong > Dear R users, > > I have a matrix x of simulated values. Each column corresponds to one > variable. > > summary(mcmc(x)) works fine > > I would like however to transform the oupu

[R] coda sweave

2010-04-27 Thread Randall Wrong
Dear R users, I have a matrix x of simulated values. Each column corresponds to one variable. summary(mcmc(x)) works fine I would like however to transform the ouput into a nice LaTeX code. xtable( summary(mcmc(x)) ) does not work. Thanks Randall [[alternative HTML version deleted]]

Re: [R] lapply - function with arguments

2010-04-13 Thread Randall Wrong
Thank you Jim 2010/4/13 jim holtman > lapply(yourList, f, a=1, b=2) > > On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong > wrote: > >> Dear R users, >> >> I have created a function f of n, a and b : f(n,a,b) >> >> I would like to apply this functio

[R] lapply - function with arguments

2010-04-13 Thread Randall Wrong
Dear R users, I have created a function f of n, a and b : f(n,a,b) I would like to apply this function several times to some values of n. a and b are held constant. I was thinking of using lapply. How can I do this ? Thank you very much Randall [[alternative HTML version deleted]]

Re: [R] Gamma parametrization

2010-03-22 Thread Randall Wrong
Thank you very much Jay. 2010/3/19 G. Jay Kerns > Dear Randall, > > On Fri, Mar 19, 2010 at 10:24 AM, Randall Wrong > wrote: > > Dear R users, > > > > ?rgamma gives me : > > > > rgamma(n, shape, rate = 1, scale = 1/rate) > > >

[R] Gamma parametrization

2010-03-19 Thread Randall Wrong
Dear R users, ?rgamma gives me : rgamma(n, shape, rate = 1, scale = 1/rate) rate: an alternative way to specify the scale. The Gamma distribution with parameters ‘shape’ = a and ‘scale’ = s has density f(x)= 1/(s^a Gamma

Re: [R] counting the number of ones in a vector

2010-03-09 Thread Randall Wrong
Thank you Gavin and Bert 2010/3/4 Gavin Simpson > On Thu, 2010-03-04 at 00:03 +0100, Randall Wrong wrote: > > Thanks to all of you ! > > > > (Benjamin Nutter, Henrique Dallazuanna, Tobias Verbeke, Jorge Ivan > > Velez, David Reinke and Gavin Simpson) > > > &g

Re: [R] counting the number of ones in a vector

2010-03-03 Thread Randall Wrong
] > On Behalf Of Henrique Dallazuanna > Sent: Friday, February 26, 2010 9:47 AM > To: Randall Wrong > Cc: r-help@r-project.org > Subject: Re: [R] counting the number of ones in a vector > > Try: > > sum(x == 1) > > On Fri, Feb 26, 2010 at 11:40 AM, Randall Wrong

[R] counting the number of ones in a vector

2010-02-26 Thread Randall Wrong
Dear R users, I want to count the number of ones in a vector x. That's what I did : length( x[x==1] ) Is that a good solution ? Thank you very much, Randall [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://s

[R] counting the number of ones in a vector

2010-02-26 Thread Randall Wrong
Dear R users, I want to count the number of ones in a vector x. That's what I did : length( x[x==1] ) Is that a good solution ? Thank you very much, Randall [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://sta

Re: [R] t-distribution values

2010-02-26 Thread Randall Wrong
Hi ! I would try "pt" for the probability distribution function. ?pt pt(q=-2, df=5) 2010/2/26 áÎÔÏÎ íÏÒËÏ×ÉÎ > > Dear all, > > > how to calculate values of t-distribution for given values of d.f. using > R > functions? > > > > > Anton > __

Re: [R] multi-argument returns

2010-02-19 Thread Randall Wrong
Thanks to Patrick Burns, Bert Gunter, Steve Lianoglou, and Professor Brian Ripley. 2010/2/17 Prof Brian Ripley > On Wed, 17 Feb 2010, Randall Wrong wrote: > > Dear R users, >> >> I have multi-argument returns in a function and I am warned by the program >> they are

[R] multi-argument returns

2010-02-17 Thread Randall Wrong
Dear R users, I have multi-argument returns in a function and I am warned by the program they are deprecated. I have found this in the R-help archives : http://tolstoy.newcastle.edu.au/R/help/01c/0319.html http://tolstoy.newcastle.edu.au/R/help/01c/0356.html Since I am not too good at programmi