search for: unwieldily

Displaying 3 results from an estimated 3 matches for "unwieldily".

Did you mean: unweildly
2010 Apr 26
4
concise syntax for selecting multiple rows
I would like to select rows if a row contains any one of several values. I can do the selection as follows: result[,"Subject"]=="JEFF" | result[,"Subject"]=="BG" But this is very unwieldily if one wishes to select many, many rows as one has to continuously repeat the source: result[,"Subject"]=="JEFF" | result[,"Subject"]=="BG" | result[,"Subject"]=="John" | result[,"Subject"]=="Mary" Is there an easie...
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
...BB" > dlist <- list(TRUE,FALSE) > apply(expand.grid(alist, blist, clist, dlist),1,function(x) paste(x[1], x[2], x[3], (x[4]), sep=""))[8:12] [1] "badAATRUE" "cadAATRUE" "aabBBTRUE" "babBBTRUE" "cabBBTRUE" This could get unwieldily if the length of the lists are appreciable, since the number of rows will be the product of all the lengths. On the other hand you could create a dataframe indexed by the variables in expand.grid's output: > master.df <- data.frame( expand.grid(alist, blist, clist, dlist),...