Re: [R] Creating Functions in R

2014-07-24 Thread Sarah Goslee
b$value - target cusums <- cumsum(deviation) data.frame(sub, deviation=deviation,cusums=cusums) } vmask(sub, 10) Note that this makes substantial assumptions about the structure of the sub argument, namely that it has a column named value. Sarah > PS: Thank you so much for he

Re: [R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
an? And how can i fix it? PS: Thank you so much for helping me with this. From: Sarah Goslee To: Pavneet Arora/UK/RoyalSun@RoyalSun Cc: r-help Date: 24/07/2014 15:04 Subject:Re: [R] Creating Functions in R Hi, On Thu, Jul 24, 2014 at 9:35 AM, Pavneet Arora wrote: > H

Re: [R] Creating Functions in R

2014-07-24 Thread jim holtman
- > David L Carlson > Department of Anthropology > Texas A&M University > College Station, TX 77840-4352 > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Pavneet Arora > Sent: Thursday, July 24, 20

Re: [R] Creating Functions in R

2014-07-24 Thread David L Carlson
lp-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pavneet Arora Sent: Thursday, July 24, 2014 8:36 AM To: r-help@r-project.org Subject: [R] Creating Functions in R Hello Guys I am new at writing Functions in R, and as a result am struggling with it. I am trying to use

Re: [R] Creating Functions in R

2014-07-24 Thread Sarah Goslee
Hi, On Thu, Jul 24, 2014 at 9:35 AM, Pavneet Arora wrote: > Hello Guys > I am new at writing Functions in R, and as a result am struggling with it. > I am trying to use Google & other resources, but it's hard to find > solutions when you don't know what to look for. How about the introduction t

[R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
Hello Guys I am new at writing Functions in R, and as a result am struggling with it. I am trying to use Google & other resources, but it's hard to find solutions when you don't know what to look for. I have the following small dataset > dput(sub) structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8,