[R] Breaking up a vector

2012-05-25 Thread AOLeary
Hi all, My problem is as follows: I want to run a loop which calculates two values and stores them in vectors r and rv, respectively. They're calculated from some vector x with length a multiple of 7. x - c(1:2058) I need to difference the values but it would be incorrect to difference it all

Re: [R] Breaking up a vector

2012-05-25 Thread AOLeary
Thank you very much, I will be more careful in future. -- View this message in context: http://r.789695.n4.nabble.com/Breaking-up-a-vector-tp4631329p4631369.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread AOLeary
My question is this: is there a way I can make one of the arguments of the function be a string the user can enter, and then have that be the excel filename? ie, foo - function(x,y,NAME){ #make a matrix with x rows and y cols M - matrix(nrow=x,ncol=y) #write the matrix write.table(M, file =

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread AOLeary
Thank you very much, that does exactly what I want it to! :) Aodhán -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4128495.html Sent from the R help mailing list archive at

Re: [R] Writing a function, want a string argument to define the name of the excel sheet to be called

2011-12-01 Thread AOLeary
Thanks Michael, I'll keep that in mind if I want to do anything more complicated. -- View this message in context: http://r.789695.n4.nabble.com/Writing-a-function-want-a-string-argument-to-define-the-name-of-the-excel-sheet-to-be-called-tp4128384p4130233.html Sent from the R help mailing list

[R] I want to create an object to use for the plot command

2011-03-19 Thread AOLeary
I'm using the TSA package (along with all prerequisites) to do some GARCH work and for some reason, something which used to work for me has decided to up and stop. The code is as follows, after loading the package: gs - garch.sim(alpha=c(1.9,0.1), beta=c(0.71, -0.083, -0.016),rnd =

Re: [R] I want to create an object to use for the plot command

2011-03-19 Thread AOLeary
Hm, thank you David, that is a good point. I'm trying to model it as a white noise model, essentially. Now that I think of it there's probably an easier way to do this that I haven't thought of yet. I was trying it this way based on something I'd remembered reading from Engle's original paper