Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-06 Thread siddu479
Thanks Arun.. I appreciate your time.. in making the generic script. I believe that this is not a very trivial question.. - Sidda Business Analyst Lead Applied Materials Inc. -- View this message in context: http://r.789695.n4.nabble.com/Excluding-fixed-number-of-rows-from-calculatio

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-06 Thread siddu479
Hi Jeff, First of all I am not a good programmer in R. I have a 2 line code in shell script using awk, head, tail and for loop combination that accomplish this task. So I thought of using R itself to do this task but I don't have any idea how to do it in R. Any way I will try to learn my own wh

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread arun
s2<-fun2(dat1,dat2)  res2 #  Unique StepNo Data1 Data2 #3  A  1 7 8 #8  B  1 4 5 ddply(res2,.(Unique,StepNo),numcolwise(mean)) A.K. - Original Message - From: siddu479 To: r-help@r-project.org Cc: Sent: Sunday, November 4, 2012 10:36 PM Subject

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread arun
StepNo),numcolwise(mean)) #not required here as there were only one row for A and B. #  Unique StepNo Data1 Data2 #1  A  1 7 8 #2  B  1 4 5   A.K. - Original Message - From: siddu479 To: r-help@r-project.org Cc: Sent: Sunday, November 4, 2012 10:

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread Jeff Newmiller
This is not a free do-my-work-for-me forum, this is a help-you-learn-R forum. If you study the solution you have been given until you understand how it works, and combine that with an understanding of indexing from the Introduction to R document that comes with R, you should be able to complete

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-05 Thread siddu479
Hi Arun, Thanks for your reply but your script is removing only one row( first row and last row) for each Unique and StepNo combination and calculating mean for the rest of rows. For below data , your script removing the #'s rows perfectly. But in reality I may need to ignore *say first 10 rows

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread arun
om: siddu479 To: r-help@r-project.org Cc: Sent: Sunday, November 4, 2012 9:40 AM Subject: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function. Hello All,   I have a .csv file( contents shown) below, where I need to calculate mean(for example) for only the rows

Re: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread arun
ject.org Cc: Sent: Sunday, November 4, 2012 9:40 AM Subject: [R] Excluding fixed number of rows from calculation while summarizing using ddply() function. Hello All,   I have a .csv file( contents shown) below, where I need to calculate mean(for example) for only the rows highlighted in bold

[R] Excluding fixed number of rows from calculation while summarizing using ddply() function.

2012-11-04 Thread siddu479
Hello All, I have a .csv file( contents shown) below, where I need to calculate mean(for example) for only the rows highlighted in bold. (i.e. in this example case I need to exclude the first row and last row(N=1) for each "*StepNo*" column) Unique,StepNo,Data1,Data2#In actual file I have