[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] Sweave

2010-08-18 Thread Randall Wrong
this: \begin{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. I would like to use the width option for the graphics : \begin

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 adasgu...@araastat.com 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 Wrong randall.wr

[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] lapply - function with arguments

2010-04-13 Thread Randall Wrong
Thank you Jim 2010/4/13 jim holtman jholt...@gmail.com lapply(yourList, f, a=1, b=2) On Tue, Apr 13, 2010 at 9:11 AM, Randall Wrong randall.wr...@gmail.comwrote: 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

[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] coda sweave

2010-04-27 Thread Randall Wrong
I forgot to say that the coda package is loaded. Randall 2010/4/27 Randall Wrong randall.wr...@gmail.com 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

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 randall.wr...@gmail.com I forgot to say that the coda package is loaded

Re: [R] coda sweave

2010-04-27 Thread Randall Wrong
On Tue, Apr 27, 2010 at 12:22 PM, Randall Wrong randall.wr...@gmail.com 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 Thinning interval = 1 Number of chains = 1 Sample size per chain = 10 1. Empirical

Re: [R] coda sweave

2010-04-29 Thread Randall Wrong
Thank you Bryan 2010/4/27 Brian Diggs dig...@ohsu.edu On 4/27/2010 1:42 PM, Randall Wrong wrote: Thank you so much Ista. I have problems with pictures too. \begin{figure} \centering fig=true= xyplot( mcmc(x) ) @ \end{figure} Why doesn't this work ? Sorry for posting all

[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

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 rip...@stats.ox.ac.uk 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 deprecated

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 áÎÔÏÎ íÏÒËÏ×ÉÎ a-morko...@yandex.ru Dear all, how to calculate values of t-distribution for given values of d.f. using R functions? Anton

[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

[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

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

2010-03-03 Thread Randall Wrong
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 randall.wr...@gmail.com wrote: Dear R users, I want to count the number of ones in a vector x. That's what I did : length( x[x==1

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 gavin.simp...@ucl.ac.uk 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) x - c(1, 1, 1, NA, NA, 2

[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

Re: [R] Gamma parametrization

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