similar to: aggregate taking way too long to count.

Displaying 20 results from an estimated 6000 matches similar to: "aggregate taking way too long to count."

2008 Aug 28
1
Interaction between aggregate() and length()
Folks, I've been running into an odd situation that occurs when I use length() function with aggregate(), but not with either one separately. Together, the results looks correct but is given an unexpected name. 'if (stringsAsFactors) factor(x) else x' instead of just 'x'. # Numbers work ok tt <- data.frame(idx=c(1,1,1,1,1,1,2,2,2,2,2,2)
2012 Jan 19
2
POSIXct value display incorrect for some values
First, the reproducable example, showing how converting from character to POSIXct to character changes the milliseconds in the first time stamp though not in the second: > as.POSIXct('2010-06-03 9:03:58.324') [1] "2010-06-03 09:03:58.323 PDT" > as.POSIXct('2010-06-03 9:03:58.325') [1] "2010-06-03 09:03:58.325 PDT" This seems to be due to truncation of
2009 Apr 02
1
Updating a data frame
Folks, Updating values in a table is simple in SAS or SQL, but I've wracked my brain looking for an elegant solution in R to no avail thus far. Certainly this is a common need that's been solved in dozens of different ways. Given an initial dataframe nn and a smaller dataframe of updates uu, I'd like to replace the values in nn <- expand.grid('a'=1:4, 'b'=1:3)
2009 Jul 10
1
RUnit detects parse error, but why?
Folks, An RUnit test suite is failing after all tests are complete with the following message: Error in parse(n = -1, file = file) : unexpected '}' at 620: 621: } All individual tests work when run individually, and all but one run within the RUnit test suite. What might be causing this? A similar error message during package creation was discussed earlier
2009 Jul 02
1
Package 'operators'
Folks, In brief -- how many of you have found the 'operators' package to be valuable in their work? Not that I lack respect for the amount of work involved in creating and maintaining a package, but I am unsure about the utility of these new operators. Several of the operators appear to offer different ways of accomplishing tasks that are already relatively easy in base R -- regular
2005 Oct 07
2
Assign references
Folks, I've run into trouble while writing functions that I hope will create and modify a dataframe or two. To that end I've written a toy function that simply sets a couple of variables (well, tries but fails). Searching the archives, Thomas Lumley recently explained the <<- operator, showing that it was necessary for x and y to exist prior to the function call, but I haven't
2012 Sep 27
1
Is there a way to source from a specific Git repository without hardcoding the location everywhere?
Folks, A small group of us are working together to develop a set of R functions to support data management and analysis using Eclipse/StatET in a Windows environment. We are using Git/EGit for version control. We work within our own repository and occasionally push to a common remote location. I'd like to have the code source files from the 'local' git repository without
2005 Jul 12
4
Calculation of group summaries
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly straight forward: data(PlantGrowth) attach(PlantGrowth) stack(mean(unstack(PlantGrowth)))
2004 Jul 18
2
a problem: factors, names, tables ..
Hi all, I am *completely* lost in trying to solve a relatively simple task. I want to compute the relative number of occurences of an event, the data of which sits in a large table (read from file). I have the occurences of the events in a table 'tt' 0 2 10 11 13 14 15 15 6 1 3 8 15 10 .. meaning that event of type '0' occurs 15 times, type '2' occurs 6 times
2002 Apr 02
1
cbind.ts bug?
The following creates a time series tt1 whose values rise from 1 to 20 and another time series tt2 each of whose values are 10 larger than the corresponding value in tt1. When we attempt to bind them together as columns, the entry after Dec 1960 is erroneously listed as NA 1960 instead of Jan 1961. If n is changed to either 19 or is changed to 21 in the example below, the example suddenly
2010 Sep 01
2
invert order
Dear R-help list users, I have a huge vector of numbers, how I can invert orden? For example x <- 1:10000000 I would like to obtain x_r <- 10000000:1 Thanks, Sebastian.
2010 Dec 09
1
how to use diff() with different variables?
Hi, I first should say I am new to R. I have searched without success the R-archives to see if I could find an answer to what I am about to ask you. My dataset is like: x fine 1 A 2010-12-09 07:57:33 2 B 2010-12-09 08:05:00 3 C 2010-12-08 20:42:00 ... that is: 'data.frame': 3 obs. of 2 variables: $ x : Factor w/ 3 levels "A","B","C":
2011 Jul 13
3
Colors in R
HI everyone, I''m trying to assign colors to multiple lines in a graph. Problem is I don''t want to type in as many colors as there are lines....is there a way around this? In brief, I''m plotting the logratio for up to 60 samples and want a different color for each sample. Here is the code I''m using now.. Any help is greatly appreciated.. Best LT data <-
2008 Dec 11
3
Logical "in" test
OK, this should be trivial but I'm not finding it. I want to compress the test, if (i==7 | i==10 | i==30 | i==50) {} into something like if (i in c(7,10,30,50)) {} so I can build a "excludes" vector excludes <- c(7,10,30,50) and test if (i in excludes) {} However, I'm not finding a clue on how to accomplish this, if it can be done. Would someone with more R
2009 Apr 22
2
R-User groups in North America (SF, LA, NYC, Ottawa)
Hi R folks, I'd like to announce several new R users groups here in SF, LA, NYC, and Ottawa - as well as their next scheduled event. The goal of these user groups, besides gently explaining 'drop=TRUE' to the uninitiated, is to exchange knowledge, promote best practices, and spur the adoption of R for innovative applications. If I've missed any groups here, please feel to add on
2009 Feb 04
3
R command to compare two vectors?
By any chance is there an R command to compare two vectors?   For example, a_tmp<-c("a", "b", "c", "d", "e", "f", "g", 'h') b_tmp<-c("a", "c", "e", "g")   I would like to compare b_tmp against a_tmp to determine if the members of b_tmp are part of a_tmp.    I tried
2011 Apr 11
4
nndist R vs. ArcGIS
Can anyone tell me why I would get different average nearest neighbor values for the same set of coordinates between ArcGIS 10 and R? Sometimes the difference in distance is over 1.3 km. Alexis -- View this message in context: http://r.789695.n4.nabble.com/nndist-R-vs-ArcGIS-tp3442375p3442375.html Sent from the R help mailing list archive at Nabble.com.
2010 Dec 10
3
Delete observations with a frequency < x
Hi, I have two columns with data (both identifiers - it's an affiliation list) and I would like to delete the rows in which the observations in the second column have a frequency < 5 in the entire second column. Example: 1 a 1 b 1 c 2 a 2 b 2 d Let's say, I would like to delete the rows in which the observation in the second column has a frequency < 2 in
2004 Nov 21
3
Help with ooplot(gplots) and error bars
Dear All I am trying to graph a proportion and CI95% by a factor with ooplot (any other better solution ?) It works well until I try to add the confidence interval. this is the error message and and a description of the data: > dat1 PointEst TT1 1 3.6 TT2 2 5.0 TT3 3 5.8 TT4 4 11.5 TT5 5 7.5 TT5 6 8.7 TT7 7 17.4 > dat2
2011 Feb 25
6
preventing repeat in "paste"
Hello! s<-"start"; e<-"end" middle<-as.character(c(1,2,3)) I would like to get the following result: "start 123 end" or "start 1 2 3 end" or "start 1,2,3 end" How can I avoide this (undesired) result: paste(s,middle,e,sep=" ") Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com