[R] using diff function with by function

2014-03-10 Thread Mckinstry, Craig
I have been trying to process a data.frame (tr) on a grouping factor (Rmbr) using diff to find differences between srv_dt (a date) by Rmbr and keep getting the following error message tmp - by(tr,tr$Rmbr, diff, tr$srv_dt, lag=1, difference=1) Error in r[i1] - r[-length(r):-(length(r) - lag +

[R] Registered, subscribed and still can't post

2014-03-06 Thread Mckinstry, Craig
I just received and email post with an R question. My problem is as described above. Thanks for your help Craig McKinstry Cambia HealthSparq 100 Market Building, 6th Floor 100 SW Market Street Portland, OR 97201 Ph: 503 225-6878 Email:

[R] question on more efficient data block-match processing

2014-03-06 Thread Mckinstry, Craig
I have a medical insurance claims datafile divided into blocks by member, with multiple lines per member. I am process these into a one line per member model matrix. Member block sizes vary from 1 to 50+. I am match attributes in claims data to columns in the model matrix and have been

[R] More efficient data-block processing -revised

2014-03-06 Thread Mckinstry, Craig
I have a medical insurance claims datafile divided into blocks by member, with multiple lines per member. I am processing these into a one line per member binary model matrix. Member block sizes vary from 1 to 50+. I am matching attributes in claims data to columns in the model matrix and have