[R] using lapply to get function values

2014-01-09 Thread Long Vo
Hi R users, I need to apply a function on a list of vectors. This is simple when I use functions that returns only one numerical value such as 'mean' or 'variance'. Things get complex when I use functions returning a list of value, such as 'acf'. In the following example I first create a list of v

Re: [R] Splitting a vector

2013-12-10 Thread Long Vo
This does what I needed. However, as the output is a list object, is there any way to apply a function to such object? For example if I want to compute the mean for the 4th subvectors, I can't simply use: # Y=split(X,as.numeric(gl(length(X),3,length(X mean(Y[4]) # as the error message

[R] Splitting a vector

2013-12-09 Thread Long Vo
Hi, I am quite new to R so I know that this probably is very basic , but how can I split a sequence of number into multiple parts with equal length? For example I have a vector X=c(1:12) I simply need to split it into sub-vectors with the same length N . Say N=3 then I need the output to be like

[R] installing package from source

2013-10-23 Thread Long Vo
Hi R users, Currently I want to fit a FIGARCH model to a dataset. The only package that allow for it that I could find is fGarch. However it seems that the FIGARCH model class fitting of this package has been moved to Oxmetrics. I tried to install the old versions of it using 'tar.gz' files from CR