Re: [R] using lapply with recode

2012-11-09 Thread arun
function(x) data.frame(x[colnames(x)!="prov"],prov=recode(x$prov,"'QUE'='QC';'Quebec'='QC'"))) A.K. - Original Message - From: Simon Kiss To: arun Cc: Sent: Friday, November 9, 2012 9:39 AM Subject: Re: [R] using lapp

Re: [R] using lapply with recode

2012-11-09 Thread arun
#5   5 17   QC #6   6  7   AB #7   7  6   AB #8   8 21   AB #9   9  5   AB #10 10  1   AB A.K. ----- Original Message - From: Simon Kiss To: arun Cc: Sent: Friday, November 9, 2012 9:39 AM Subject: Re: [R] using lapply with recode Hi there: None of these suggestions do the work. I tried J

Re: [R] using lapply with recode

2012-11-08 Thread arun
Original Message - From: Simon Kiss To: r-help@r-project.org Cc: Sent: Thursday, November 8, 2012 10:06 PM Subject: [R] using lapply with recode Hello: Forgive me, this is surely a simple question but I can't figure it out, having consulted the help archives and "Data Manipulation Wit

Re: [R] using lapply with recode

2012-11-08 Thread arun
a   prov #1   1 Quebec #2   2 Quebec #3   3 Quebec #4   4 Quebec #5   5 Quebec #6   6 AB #7   7 AB #8   8 AB #9   9 AB #10 10 AB A.K. - Original Message - From: Simon Kiss To: r-help@r-project.org Cc: Sent: Thursday, November 8, 2012 10:06 PM Subject: [R] using lapply

Re: [R] using lapply with recode

2012-11-08 Thread Jim Holtman
you need to return 'x' as the last statement of the lapply. Sent from my iPad On Nov 8, 2012, at 22:06, Simon Kiss wrote: > Hello: > Forgive me, this is surely a simple question but I can't figure it out, > having consulted the help archives and "Data Manipulation With R" (Spector). > I have

[R] using lapply with recode

2012-11-08 Thread Simon Kiss
Hello: Forgive me, this is surely a simple question but I can't figure it out, having consulted the help archives and "Data Manipulation With R" (Spector). I have a list of 11 data frames with one common variable in each (prov). I'd like to use lapply to go through and recode one particular leve