similar to: aggregate text column by a few rows

Displaying 20 results from an estimated 7000 matches similar to: "aggregate text column by a few rows"

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 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',
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]]
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,
2010 Dec 28
14
cerating multiple cjeck boxes using array
i have a registration form ,i want to store data in corresponding user table in that hobbies field ,i want to store all hobbies in one column so i take multiple check boxes and store in one array all checked values for that i am using below tag,but not working,please any suggestion <%= check_box(:user ,:hobbies,:value =>''Games'') %>Games <%= check_box :user ,
2014 Jul 09
3
error com un archivo
Hola a todos, Me gustaria pedir vuestra ayuda a encontrar el error que no consigo encontrar en este archivo. He revisado todo mil veces y probado y no doy con ello.Adjunto el archivo con Google drive porque es muy grande. ? monicap_50.csv <https://docs.google.com/file/d/0B8o2KrPEgG7ATlBMc19lTVk1d3M/edit?usp=drive_web> ? Este es el script, y lo que no entiendo que pasa es que tengo 592044
2011 Dec 21
1
aggregate function
Hi I have a data frame with values in following format. param case1 1 a 2 b 2 c 2 d 3 e 4 f how to use aggregate so that it I only one row for each 'param' value. the output for the above input should be param case1 1 a 2 b,c,d 3 e 4 f Thanks M -- ------------- Mary
2014 Jun 04
2
error de incompatible methods
Hola Daniel, si perdona di a responder directamente y no me di cuenta. Ya se donde esta el error, pero queria preguntar si a puede ser que mi R funcione mal o algo porque esta manhana ejecute mi script y funciono perfectamente y ahora volvi a ejecutarlo y me volvio a dar el mismo problema de ayer , despues de reiniciar y demas el tinnR y el R, no se si me vacila o es que tengo algo mal en
2011 Jun 10
2
Sorting Data Frame Without Loop
Hello all! I am currently trying to sort a data frame in a particular way, but I am having some difficulties with this. Specifically I want to sort the below dataset in such a way that there is only one line per ProteinID and if there are multiple GeneID or GeneName entries for a single proteinID, that they be concatenated with a comma separating them. The way I have done it earlier worked fine
2009 Jan 29
2
Solution for SOLA-330 UPS !!!
Hi To all on this list... I emailed the EATON (the company that has bought out SOLA) to request some information about the pin-out for this model UPS and I got a reply today! The answer is really simple! this model UPS just uses a normal serial cable that is pin 1-1 through to 9 -9 and I now have it work as it should via the megatec driver :) Scott Evans VK7HSE Phone: +61362291658 Mobile:
2007 Oct 19
2
header
Hi everyone, I read the following data > setwd("d:/") > mydata <- read.table("mydata.txt", header=T) > attach(mydata) > mydata name X20_1_TT_Z_e4 X20_2_TT_Z_e4 1 A1 102 22 2 A2 103 21 3 A3 107 20 > name [1] A1 A2 A3 Levels: A1 A2 A3 > mode(name) [1] "numeric" Why name is
2013 Mar 06
1
need help using read.fortran
Hello kind and R-knowledgeable souls! I am trying to use read.fortran to read in old datasets in 80-column-card format with no separators between variables (just 80 columns of solid digits). I comprehend the instructions for specifying the columns for each variable, but I can't understand how to assign the variable names after reading the help pages for read.fortran, read.fwf and
2009 Jan 25
2
SOLA-330 2 Questions !!!
Hi... I'm almost to the point of pulling hair! I was recently given a SOLA-330 UPS However, it didn't come with the comms cable so I'm having some trouble trying to find a pin-out for this UPS and secondly exactly what driver to use with NUT ?? I've got the users manual for a SOLA-325 (from website) and this has a pin-out for this model but clearly it's not the same for
2013 Nov 19
1
Amazon, Asterisk and reliability beyond a hobby system?
Took me a while but I have finally embraced cloud computing and all the benefits. The only thing I have yet to feel comfortable about putting in the cloud is real live Asterisk boxes to be used in production. I know it's being done because as far as I know Twilio is using Amazon for their Asterisk boxes. I have read all the fun articles on building hobby type systems and that's all great.
2007 Jul 11
2
inquiry about anova and ancova
Dear R users, I have a rather knotty analysis problem and I was hoping that someone on this list would be able to help. I was advised to try this list by a colleague who uses R but it is a statistical inquiry not about how to use R. In brief I have a 3x2 anova, 2 tasks under 3 conditions, within subjects. I also took a variety of personality measures that might influence the results under the
2003 Sep 09
2
Samba and CUPS Config Issue
We are trying to migrate from Samba/LPRng to Samba/CUPS and have hit some snags. We're using the Samba box as a print server for our corporate network, and have a variety of Windows versions on the network. The problem we're having is with our Windows 95 clients. Win95 uses the printer comment when it maps to the printer on the server. However, when we connect to a printer, we no
2005 May 10
58
A quick straw poll
How many of you are using Rails: 1. As the primary development tool at your Day Job 2. As a small part of your Day Job 3. Not using Rails in your Day Job, but are using Ruby 4. For OS/outside work/hobby -- sam http://www.magpiebrain.com/