similar to: aggregate a Date column does not work?

Displaying 20 results from an estimated 5000 matches similar to: "aggregate a Date column does not work?"

2010 Oct 07
3
aggregate text column by a few rows
Hi, R function aggregate can only take summary stats functions, can I aggregate text columns? For example, for the dataframe below, > a <- rbind(data.frame(id=1, name='Tom', hobby='fishing'),data.frame(id=1, name='Tom', hobby='reading'),data.frame(id=2, name='Mary', hobby='reading'),data.frame(id=3, name='John',
2010 Mar 09
5
data frame select max group by like function
Hi, I have a data frame with 3 columns: ID, year and score. How can I select for each unique ID, the year that has the max score? For example, for data frame ID, year, score tom, 1995, 88 rick, 1994, 90 mary, 2000, 97 tom, 1998, 60 mary, 1998,100 I shall have ID, year, score tom, 1995, 88 rick, 1994, 90 mary, 1998,100 Thanks, Richard [[alternative HTML version deleted]]
2009 Apr 13
3
toupper does not work in sub + regex
Hi, I don't know what I am doing wrong to the toupper does not seem working in sub + regex. The following returns 's' not the upper class 'S' as I expect: sub("q_([a-z])[a-zA-Z]*",toupper('\\1'),"q_sviRaw") Can someone tell me where I did wrong? Thanks, Richard [[alternative HTML version deleted]]
2010 Sep 16
3
get top n rows group by a column from a dataframe
Hi, is there an R function like sql's TOP key word? I have a dataframe that has 3 columns: company, person, salary How do I get top 5 highest paid person for each company, and if I have fewer than 5 people for a company, just return all of them? Thanks, Richard [[alternative HTML version deleted]]
2012 Jan 25
5
Error: err:module:LdrInitializeThunk Main exe initialization
Hello, I'm new at installing programs to use with wine (well, except the ones that just worked with no problems). I have been trying to run Payday: The Heist and I load up the exe in terminal and I get this: > err:module:import_dll Library d3dx9_40.dll (which is needed by L"C:\\ Program Files\\Payday The Heist\\payday_win32_release.exe") not found >
2009 Mar 13
1
search for string insider a string
Hi, sorry if it is a too stupid question, but how do I a string search in R: I have a dataframe A with A$test like: test1 bcdtestblabla2.1bla cdtestblablabla3.88blabla and I want to search for string that start with 'dtest' and ends with number and return the location of that substring and the number, so the end result would be: NA NA 3 2.1 2 3.88 I find grep can
2009 Jun 08
1
Regex question to find a string that contains 5-9 alpha-numeric characters, at least one of which is a number
Hi, This is not exactly an R question but I am trying to use gsub to replace a string that contains 5-9 alpha-numeric characters, at least one of which is a number. Is there a good way to write it in a one line regex? Thanks, Richard
2010 Nov 24
0
4. Rexcel (Luis Felipe Parra)-how to run a code from excel
Hi Louis, It's simple to run a r script from the excel spreadsheet. Just write your code, source("C:\\Quantil Aplicativos\\Genercauca\\BackwardSelectionNC.r"), into a cell of a workingsheet. Then right-click the cell and select "run code" in the pop-up menu. Hope this will help you. Best, Bernard -----????----- ???: r-help-bounces at r-project.org [mailto:r-help-bounces
2010 Sep 06
3
Failure to aggregate
I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h (hour). Surprisingly, I cannot calculate a simple aggregate over the dataframe. > n.h1 = sqldf("select distinct h, count(*) from x group by h") Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table: x) In addition: Warning message: In
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi, I have a correlation matrix of about 3000 items, i.e., a 3000*3000 matrix. For each of the 3000 items, I want to get the top 50 items that have the highest correlation with it (excluding itself) and generate a data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those 3000 items each repeat 50 times, and ID2 is the top 50 correlated items with ID,
2007 Mar 05
4
Identifying points in a plot that have duplicate values
I have code like this: - #----------------------------------------------------------------------- ------------------------------------------------------ x=scan() 0 0 0 0 0 1 2 3 4 y=scan() 1 1 1 2 2 1 3 4 5 plot(x,y) identify(0,1,3) #Allows me to select manually to identify co-ordinate (0,1) as being duplicated 3 times identify(0,2,2) #Allows me to select manually to identify co-ordinate
2010 Mar 15
1
Aggregate and select mode
Greetings Everyone - I have a data frame "x" that looks like this: v1 v2 1 A 1 B 1 B 2 B 2 W 2 W 3 D 3 D 3 Z What I would like to do is create a new data frame, "y", that has one row for each unique value of v1, and returns the corresponding mode of v2. If I were to run it on the above data frame, it should therefore return: v1 v2 1
2013 Sep 17
1
ayuda con aggregate
Hola, ¿qué tal? Creo que la forma más limpia es usar la función ddply de plyr aproximadamente así: ddply(mis.datos, .(B, C), summarise, mean.X2 = mean(X2), medianX4 = median(X4), etc. ) La sección "Using ddply" de http://www.cookbook-r.com/Manipulating_data/Summarizing_data/ lo expica bastante bien. Un saludo, Carlos J. Gil Bellosta
2011 Jan 20
6
Identify duplicate numbers and to increase a value
Hi everybody. I want to identify duplicate numbers and to increase a value of 0.01 for each time that it is duplicated. Example: x=c(1,2,3,5,6,2,8,9,2,2) I want to do this: 1 2 + 0.01 3 5 6 2 + 0.02 8 9 2 + 0.03 2 + 0.04 I am trying to get something like this: 1 2.01 3 5 6 2.02 8 9 2.03 2.04 Actually I just know the way to identify the duplicated numbers rbind(x, duplicated(x) |
2010 Jul 16
2
aggregate(...) with multiple functions
hi all - i'm just wondering what sort of code people write to essentially performa an aggregate call, but with different functions being applied to the various columns. for example, if i have a data frame x and would like to marginalize by a factor f for the rows, but apply mean() to col1 and median() to col2. if i wanted to apply mean() to both columns, i would call: aggregate(x, list(f),
2010 Jan 04
4
function in aggregate applied to specific columns only
I want to use aggregate with the mean function on specific columns gender <- factor(c("m", "m", "f", "f", "m")) student <- c(0001, 0002, 0003, 0003, 0001) score <- c(50, 60, 70, 65, 60) basicSub <- data.frame(student, gender, score) basicSubMean <- aggregate(basicSub, by=list(basicSub$student), FUN=mean, na.rm=TRUE) This
2008 Jan 26
3
Comparison of aggregate in R and group by in mysql
Hi, netters, First of all, thanks a lot for all the prompt replies to my earlier question about "merging" data frames in R. Actually that's an equivalence to the "join" clause in mysql. Now I have another question. Suppose I have a data frame X with lots of columns/variables: Name, Age,Group, Type, Salary. I wanna do a subtotal of salaries: aggregate(X$Salary,
2016 Jun 05
4
[Bug 96391] New: Payday: The Heist has rendering issues when anti-aliasing enabled
https://bugs.freedesktop.org/show_bug.cgi?id=96391 Bug ID: 96391 Summary: Payday: The Heist has rendering issues when anti-aliasing enabled Product: Mesa Version: git Hardware: Other OS: All Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/nouveau
2017 Aug 11
2
Package sqldf in R and dates manipulation
Dear all, I recently read the book " R data preperation and manipulation using sqldf package" by Djoni Darmawikarta However, I have a problem with manipulation of dates using this package, I do not get the expected results. Do I need to install some packages to be able to subset the data by dates in sqldf? I am not getting Djoni Darmawikarta email address. Please see the practice
2011 Mar 09
2
SQLDF - Submitting Queries with R Objects as Columns
Fellow R programmers, I'd like to submit SQLDF statements with R objects as column names. For example, I want to assign "X" to "var1" (var1<-"X") and then refer to "var1" in the SQLDF statement. SQLDF needs to understand that when I reference "var1", it should look for "X" in the dataframe. This is necessary because my SQLDF