Displaying 2 results from an estimated 2 matches for "aadaa".
Did you mean:
aaaa
2008 Dec 22
2
How can I avoid nested 'for' loops or quicken the process?
Hi All,
I'm still pretty new to using R - and I was hoping I might be able to get
some advice as to how to use 'apply' or a similar function instead of using
nested for loops.
Right now I have a script which uses nested for loops similar to this:
i <- 1
for(a in Alpha) { for (b in Beta) { for (c in Gamma) { for (d in Delta) {
for (e in Epsilon)
{
Output[i] <-
2008 Dec 29
0
Serial Correlation Test for Short Time Series
...quot; "cad"
> clist <- list("AA","BB")
> apply(expand.grid(alist, blist, clist),1,function(x) paste(x[1],
x[2], x[3], sep=""))
[1] "aabAA" "babAA" "cabAA" "aacAA" "bacAA" "cacAA" "aadAA" "badAA"
"cadAA" "aabBB"
[11] "babBB" "cabBB" "aacBB" "bacBB" "cacBB" "aadBB" "badBB" "cadBB"
> dlist <- list(TRUE,FALSE)
> apply(expand.grid(alist, blist, clist, dlist),1...