[R] FW: variable format

2007-09-07 Thread Cory Nissen
Anybody? From: Cory Nissen Sent: Tue 9/4/2007 9:30 AM To: r-help@stat.math.ethz.ch Subject: variable format Okay, I want to do something similar to SAS proc format. I usually do this... a - NULL a$divisionOld - c(1,2,3,4,5) divisionTable

Re: [R] FW: variable format

2007-09-07 Thread Cory Nissen
Becker [mailto:[EMAIL PROTECTED] Sent: Fri 9/7/2007 10:55 AM To: Cory Nissen Cc: r-help@stat.math.ethz.ch Subject: Re: [R] FW: variable format Dear Cory, I am not familiar with SAS, but is this what you are looking for? divisionTable - matrix(c(1, New England, 2, Middle

Re: [R] by group problem

2007-09-04 Thread Cory Nissen
3:51 AM To: Cory Nissen Cc: r-help@stat.math.ethz.ch Subject: RE: [R] by group problem Hi now I understand better what you want topN.2 - function(data,n=5) data[order(data[,3], decreasing=T),][1:n] # I presume data is data frame with 3 columns and the third is percent lapply(split(data,data

[R] variable format

2007-09-04 Thread Cory Nissen
Okay, I want to do something similar to SAS proc format. I usually do this... a - NULL a$divisionOld - c(1,2,3,4,5) divisionTable - matrix(c(1, New England, 2, Middle Atlantic, 3, East North Central, 4, West North

[R] by group problem

2007-08-31 Thread Cory Nissen
I am working with census data. My columns of interest are... PercentOld - the percentage of people in each county that are over 65 County - the county in each state State - the state in the US There are about 3100 rows, with each row corresponding to a county within a state. I want to

Re: [R] by group problem

2007-08-31 Thread Cory Nissen
) Error in aggregate.data.frame(as.data.frame(x), ...) : 'FUN' must always return a scalar Thanks cn From: Petr PIKAL [mailto:[EMAIL PROTECTED] Sent: Fri 8/31/2007 8:15 AM To: Cory Nissen Cc: r-help@stat.math.ethz.ch Subject: Odp: [R] by group problem Hi