[R] Gibbs sampling

2011-04-05 Thread Liliana Pacheco
HI R users, perhaps you can help me with this: I am planning on using the Gibbs sampler for the correlation coefficient of a bivariate normal. I have a posterior distribution for rho, besides that, the conditional distribution for all the parameters of this posterior distribution. The thing is tha

[R] Frequency tables including the zero frequencies

2010-11-23 Thread Liliana Pacheco
Hi R users I want to make a table of frequencies to show how many times the numbers form 0 to 10 appear in a vector. For example, if the vector is: > x [1] 5 10 3 5 10 10 3 6 10 1 10 3 7 1 10 3 6 9 3 3 In this case I want a table that will show that the zero has frequency 0, the o

[R] Decimal places in a function output

2010-11-10 Thread Liliana Pacheco
urn(sprintf("%.5f",d[i-1])) } d is a vector with the numbers I need, specially the last one. how can I get the resulting number of the function with a certain amount of decimal places? Thanks. Liliana Pacheco [[alternative HTML version deleted]]