search for: rgame

Displaying 8 results from an estimated 8 matches for "rgame".

Did you mean: game
2009 Jan 27
2
working with tables -- was Re: Mode (statistics) in R?
Ok, so I'm slowly figuring out what a factor is, and was able to follow the related thread about finding a mode by using constructs like my_mode = as.numeric(names(table(x))[which.max(table(x))]) Now, suppose I want to keep looking for other modes? For example, Rgames> sample(seq(1,10),50,replace=TRUE)->bag Rgames> bag [1] 2 8 8 10 7 3 2 9 8 3 8 9 6 6 10 10 7 1 [19] 9 5 4 3 3 5 10 3 6 3 2 8 4 2 1 10 6 2 [37] 6 6 9 8 6 8 8 4 3 6 3 9 5 1 Rgames> names(which.max(table(bag))) [1] "3" I can then d...
2011 Dec 01
1
strange row numbering after rbind-ing a list
...matters, but" Can someone explain how the row numbers get assigned in the following sequence? It looks like something funky happens when rbind() coerces 'bar' into a dataframe. In either sequence of rbind below, once you get past the first two rows, the row numbers count normally. Rgames> (foo<-data.frame(x=5,y=4,r=3)) x y r 1 5 4 3 Rgames> (bar<-list(x=4,y=5,r=6)) $x [1] 4 $y [1] 5 $r [1] 6 Rgames> (foobar<- rbind(foo,bar)) x y r 1 5 4 3 2 4 5 6 Rgames> (foobar<- rbind(foobar,bar)) x y r 1 5 4 3 2 4 5 6 3 4 5 6 Rgames> (barfoo<-rbind(b...
2011 Sep 13
1
stupid lm() question
I feel bad even asking, but: Rgames> data(OrchardSprays) Rgames> model<-lm(decrease~.,data=OrchardSprays) Rgames> model Call: lm(formula = decrease ~ ., data = OrchardSprays) Coefficients: (Intercept) rowpos colpos treatmentB treatmentC 22.705 -2.784 -1.234 3.000 20.625...
2011 Nov 18
3
tip: large plots
Hi all, I'm working with a bunch of large graphs, and stumbled across something useful. Probably many of you know this, but I didn't and so others might benefit. Using pch="." speeds up plotting considerably over using symbols. > x <- runif(1000000) > y <- runif(1000000) > system.time(plot(x, y, pch=".")) user system elapsed 1.042 0.030 1.077
2011 Jan 04
1
function masking and gmp questions
...package. It fails because it calls apply() internally, like this: apply(mymatrix,1,max,na.rm=TRUE) , but the code in the gmp package which sets up the operator overload for apply() strictly limits the arguments to the first three (a matrix, a dimension, and a function). I get, no surprise: Rgames> xs<-sin(seq(1,100)/10) Rgames> turnpoints(xs) Error in apply(ex, 1, max, na.rm = TRUE) : unused argument(s) (na.rm = TRUE) I'm assuming this is a bug in gmp code and will ask the owner of that package about it. But in the meantime, is there some way to force a function to searc...
2011 Nov 06
1
Deleting rows dataframe in R conditional to “if any of (a specific variable) is equal to”
Dear list, I have been struggling for some time now with this code... I have this vector of unique ID "EID" of length 821 extracted from one of my dataframe (skate). It looks like this: > head(skate$EID) [1] "896-19" "895-8" "899-1" "899-5" "899-8" "895-7" I would like to remove the complete rows in another dataframe
2012 Apr 06
3
filling the matrix row by row in the order from lower to larger elements
Hello, everybody! I have a matrix "input" (see example below) - with all unique entries that are actually unique ranks (i.e., start with 1, no ties). I want to assign a value of 100 to the first row of the column that contains the minimum (i.e., value of 1). Then, I want to assign a value of 100 to the second row of the column that contains the value of 2, etc. The results I am looking
2011 Oct 13
5
Counting the number of integers at one swoop
Dear R users, I'd like to count the number of integers in a vector y. Here is an example. y <- c(0,1,1,3,3,3,5,5,6) In fact, I know how to count the number of specific number in y. sum(y==0) -> 1 sum(y==1) -> 2 sum(y==2) -> 0 sum(y==3) -> 3 sum(y==4) -> 0 sum(y==5) -> 2 sum(y==6) -> 1 However, in one computation I want to get this vector [1,2,0,3,0,2,1]. Thank