similar to: data frame select max group by like function

Displaying 20 results from an estimated 20000 matches similar to: "data frame select max group by like function"

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',
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]]
2010 Nov 22
2
aggregate a Date column does not work?
Hi, I am trying to aggregate max a Date type column but have weird result, how do I fix this? > a <- rbind( + data.frame(name='Tom', payday=as.Date('1999-01-01')), + data.frame(name='Tom', payday=as.Date('2000-01-01')), + data.frame(name='Pete', payday=as.Date('1998-01-01')), + data.frame(name='Pete',
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
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,
2018 Jun 07
3
FTS Solr errors using doveadm
Solr 7 returns JSON by default but fts_solr requires XML. Would be good to have wt=xml added to the query to force it to xml all the time, this would prevent errors if solr has not had xml set as default for index. Dovecot 2.2.36 Centos 6 *Doveadm Request:* doveadm search -u caroline at covermg.com TEXT smith doveadm(caroline at covermg.com): Error: fts_solr: Invalid XML input at 1:0: not
2001 Sep 25
2
max-min plot
Hello R-list members, I’m trying to make a min-avg-max plot (like a boxplot, without box and outliers, i.e., for each class of "x" a vertical line indicating the range (max-min) and an horizontal line or point indicating the mean) with data like: Year Avg Min Max 98 10 7 13 99 12 10 15 01 11 6 14 Which command should be used? Many thanks, Antonio Olinto
2005 Jun 20
2
Data Parsing
Hello. I have looked at R Site Search for this problem, and it didn't give me exactly what I needed. Consider this dataset called "results". It has the following information: Student Day Subject Score Mary 1 Math Failed David 2 Science Passed Bob 4 Reading Passed Marie 4
2011 Jul 04
1
placing multiple rows in a single row
Dear people from the R help list, I have a question that I can't get my head around to start answering, that is why I am writing to the list. I have data in a format like this (tabs might look weird): John A1 1 0 1 John A2 1 1 1 John A3 1 0 0 Mary A1 1 0 1 Mary A2 0 0 1 Mary A3 1 1 0 Peter A1 1
2006 Jan 07
8
Using find_by_sql to get the sum of a column
Hello, I was wondering if there was a method in Rails that returns the sum of a column. For example, I have a column called ''score'' and writing a SQL statement such a ''select sum(score) from table_name'' does return the sum of the values in the column. In the past (not too long ago being a newbie), I defined all sorts of methods only to discover that Rails
2008 Jul 01
17
Memory leak scripts
Hola, I am trying to isolate the memory leak I suspect in a mailman installation ? I found: http://blogs.sun.com/sanjeevb/date/200506 It gives an error: god at irt-smtp-02:~ 9:21am 65 # ./memleak.d 10312 dtrace: failed to compile script ./memleak.d: line 3: probe description pid10312:libc.so.1:malloc:entry does not match any probes I am on SunOS 5.10 Generic_127112-07 i86pc i386 i86pc Are
2006 Nov 23
1
how to loop this?
Hi, I have the next procedure: t1<-data.frame(table(substr(names(subset(lasker[[1]], lasker[[1]] >= 4)), 1, 7))) t1[1:5,] Var1 Freq 1 1988-02 3 2 1988-03 1 3 1988-04 1 4 1988-05 2 5 1988-06 3 How to make a new list?, dataframe? having 189 elements in the 'lasker' list: > str(lasker[[1]]) 'table' int [, 1:1274] 1 1 3 2 1 5 4 1 1 4 ... -
2016 Jun 02
7
[PATCH -next 0/2] virtio-net: Advised MTU feature
The following series adds the ability for a hypervisor to set an MTU on the guest during feature negotiation phase. This is useful for VM orchestration when, for instance, tunneling is involved and the MTU of the various systems should be homogenous. The first patch adds the feature bit as described in the proposed VFIO spec addition found at
2016 Jun 02
7
[PATCH -next 0/2] virtio-net: Advised MTU feature
The following series adds the ability for a hypervisor to set an MTU on the guest during feature negotiation phase. This is useful for VM orchestration when, for instance, tunneling is involved and the MTU of the various systems should be homogenous. The first patch adds the feature bit as described in the proposed VFIO spec addition found at
2006 Nov 22
3
dataframe manipulation
Hi, Having a dataframe 'l1' (dput output is below): >dim(l1) 1274 2 >l1[1:12,] Var1 Freq 1 1988-01-13 1 2 1988-01-16 1 3 1988-01-20 3 4 1988-01-25 2 5 1988-01-30 1 6 1988-02-01 5 7 1988-02-08 4 8 1988-02-14 1 9 1988-02-16 1 10 1988-02-18 4 11 1988-02-24 2 12 1988-03-04 1 I want to extract the times
2004 Jul 26
5
aggregate function
Hi all, I have the folowing frame(there are more columns than shown), 1 2 3 4 5 Year Total Tus Whi Norw 1994 1.00 1830 0 355 1995 1.00 0 0 0 1995 1.00 0 0 0 1995 1.00 4910 4280 695 1997 1.00 0 0
2008 May 09
2
Tabulation of aggregated data.frame
Hi useRs! I would like to know how to make aggregated data.frame with aggregate() tabulated. For example, I run the following command to aggregate re with respect to group1 and group2. > (aggr <- with(final, aggregate(re, group1, group2, mean))) Group.1 Group.2 x 1 1992 15 0.16392 2 1993 15 0.15467 3 1994 15 0.15456 4 1995 15 0.15391
2007 Dec 19
3
plot cummulative sum from calendar time
I have the following list of observations of calendar time: [1] 03-Nov-1997 09-Oct-1991 27-Aug-1992 01-Jul-1994 19-Jan-1990 12-Nov-1993 [7] 08-Oct-1993 10-Nov-1982 08-Dec-1986 23-Dec-1987 02-Aug-1995 20-Oct-1998 [13] 29-Apr-1991 16-Mar-1994 20-May-1991 28-Dec-1987 14-Jul-1999 27-Nov-1998 [19] 09-Sep-1999 26-Aug-1999 20-Jun-1997 05-May-1995 26-Mar-1998 15-Aug-1994 [25] 24-Jun-1996 02-Oct-1996