[R] Error Message from R

2007-10-13 Thread Rutendo Dadiso Kaviya
Hi, I am trying to calculate the descretionary accruals using the bootstrapping technique with the R program, but I keep getting an error message. Previously, after typing in the command on the front sreen, R would return the output without any problems. I am now using a different

Re: [R] How to identify the two largest peaks in a trimodal distribution

2007-10-13 Thread Paul Smith
On 10/13/07, Rob Knell [EMAIL PROTECTED] wrote: I'm trying to do a simulation that involves identifying the minimum point between two peaks of a (usually) bimodal distribution. I can do this easily if there are only two peaks: CnBdens-density(Ys/Xs) #probability density function for ratio of

Re: [R] embedding plots

2007-10-13 Thread Jim Lemon
Josue G. Martinez wrote: Hello! I am trying to embed a plot of a curve(say x^2) on a matrix that I am viewing using the image(matrix) command. I was wondering if someone could give me some idea of how to do this. Hi Jose, This may be way off what you want, but:

Re: [R] A read.table mystery (data for Filemaker Mac)

2007-10-13 Thread Mark Wardle
On 12/10/2007, Emmanuel Charpentier [EMAIL PROTECTED] wrote: Mark Wardle a écrit : 1. Which version of Filemaker? NB: Framemaker is a different program (desktop publishing), so do be a little precise! Dunno. The file is named export.fm7 ; one might be tempted to infer Filemaker 7.

Re: [R] collapsing a data frame

2007-10-13 Thread Gabor Grothendieck
As far as I know you will have to do some work yourself but if we leverage some of it off the summaryBy function in doBy its basically just a lapply over the columns. The first arg to collapse is a formula whose rhs contains the by variables and whose lhs is ignored. data is our data frame,

Re: [R] collapsing a data frame

2007-10-13 Thread Gabor Grothendieck
The library statement should have been library(doBy). Also note that collapse assumes that all by variables are factors although it would only add one statement to collapse to coerce them to factors if we wanted that. On 10/13/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: As far as I know you

[R] a question on impulse responses

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these

[R] vars shocks assumption

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these

[R] impulse responses: standard deviation or unit shocks?

2007-10-13 Thread Martin Ivanov
Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model. Unfortunately I do not know whether these functions assume unit or one standard deviation shocks. I tried to look into the code of these

[R] Controlling values in read.table

2007-10-13 Thread Svempa
I have this code: list1 - list() for (i in list.files(pattern=.*c02.*AFDH0.*)){ x - read.table(i,skip=20,fill=TRUE) list1[[i]] - x } Somehow I would like the read.table function to read only values in each file that are over a certain limit, say 1. Is this the easiest way or is it better

[R] geom_errorbar with ggplot2

2007-10-13 Thread Pedro de Barros
Dear All, I am trying to build an error bar plot with ggplot2. However, even if the code seems to work, the plot is rather odd, with what seems to be a continuous line linking the different bars. I attach below the code I used, as well as the data.

Re: [R] geom_errorbar with ggplot2

2007-10-13 Thread hadley wickham
Hi Pedro, That's a bug in the current version of ggplot. I'll try to get a new version on CRAN soon, but if you let me know what platform you're on, I can send you a fixed version right away. Hadley On 10/13/07, Pedro de Barros [EMAIL PROTECTED] wrote: Dear All, I am trying to build an

[R] the use of the .C function

2007-10-13 Thread Bernardo Lagos Alvarez
Hi all, here others doubts, when load and running the function void gdot(double *x,double *y,int *n,double *output){ int i; *output=0; for (i=0;i*n;i++){ *output+=x[i]*y[i]; } } as following /examplesC$ R CMD SHLIB xby.c gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include -fpic

Re: [R] How to identify the two largest peaks in a trimodal distribution

2007-10-13 Thread jim holtman
You can use 'rle' to find where the direction changes and use that to determine the peaks: # create test data x - seq(-2,7, length=2000) y - dnorm(x) + dnorm(x,3) plot(y,type='l') # find where direction changes from plus to minus z - rle(diff(y) 0)# find where breaks are z Run Length

Re: [R] Controlling values in read.table

2007-10-13 Thread jim holtman
just store in the list the values you want: list1 - list() for (i in list.files(pattern=.*c02.*AFDH0.*)){ x - read.table(i,skip=20,fill=TRUE) list1[[i]] - subset(x, value 1.0) } On 10/13/07, Svempa [EMAIL PROTECTED] wrote: I have this code: list1 - list() for (i in

Re: [R] the use of the .C function

2007-10-13 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The code is C++ and so is compiled using the C++ compiler, not the C compiler. This is because the name of the file is .cpp (and you include iostream.h, but don't seem to make any use of it.) As a result, the names of the routines are mangled and so

Re: [R] the use of the .C function

2007-10-13 Thread Katharine Mullen
Let me also comment that you are trying to interface to a function ported to C++ from the Cephes library, which is in C. You have not explained why you are trying to interface to the function (is this an exercise, or do you suspect a problem with digamma()?), but if you just want access to it as

[R] reading data and Variance Ratio Tests for Weak-form Market Efficiency

2007-10-13 Thread Jasim Al-AJmi
Dear Rhelp I am first time user of R and I have the following questions: 1. How I can load my data (it is a matrix 10x1618) with the titles of the variables in the first row? 2. How I can run vrtest to calculate Variance Ratio Tests for Weak-form Market Efficiency? Thanks in advance.

Re: [R] Error Message from R

2007-10-13 Thread Ben Bolker
Rutendo Dadiso Kaviya wrote: Hi, I am trying to calculate the descretionary accruals using the bootstrapping technique with the R program, but I keep getting an error message. Previously, after typing in the command on the front sreen, R would return the output without

Re: [R] Question re matplot

2007-10-13 Thread David Kaplan
Yea, sorry, that was a typo when I copied into my emal. Here it is again matplot(battingagg$X, battingagg[, c(HR,RBI,X2B, BB, R, SB)], type=b,lty=4,lwd=2, col=1:4,xlab = Year, ylab = (1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB, pty=m,sub = Figure 2. Plot of Selected Offensive Baseball

Re: [R] Question re matplot

2007-10-13 Thread Marc Schwartz
On Sat, 2007-10-13 at 22:16 -0500, David Kaplan wrote: Yea, sorry, that was a typo when I copied into my emal. Here it is again matplot(battingagg$X, battingagg[, c(HR,RBI,X2B, BB, R, SB)], type=b,lty=4,lwd=2, col=1:4,xlab = Year, ylab = (1)HRs, (2)RBIs, (3)DOUBLES,(4)BB,(5)Runs,(6) BB,

Re: [R] a question on impulse responses

2007-10-13 Thread sj
I am pretty sure, it is a unit shock. I think that it says in th documentation. On 10/13/07, Martin Ivanov [EMAIL PROTECTED] wrote: Dear R users, I am using the vars package to calculate the impulse response functions and the forecast error variance decomposition of a VAR model.