Hello, I found this email when looking for some help with R Studio. It's actually my daughter who is looking for help. It sounds like she is working with the very basics of this software, and her task is to write the code which would result in the extraction of "odd" data from a dataset of restaurant sales. This is a shot in the dark...please ignore if my question makes little or no sense. I have no working knowledge of R software. Thanks. [[alternative HTML version deleted]]
Hi Darren, You're probably looking for the %% (remainder) operator: x<-1:10 # get odd numbers x[as.logical(x%%2)] # get even numbers x[!(x%%2)] Jim On Sun, Mar 3, 2019 at 4:10 PM Darren Danyluk <Darren.Danyluk at sd6.bc.ca> wrote:> > Hello, > > I found this email when looking for some help with R Studio. It's actually my daughter who is looking for help. > > It sounds like she is working with the very basics of this software, and her task is to write the code which would result in the extraction of "odd" data from a dataset of restaurant sales. > > This is a shot in the dark...please ignore if my question makes little or no sense. I have no working knowledge of R software. > > Thanks. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi Darren, On Sat, 2 Mar 2019 22:27:55 +0000 Darren Danyluk <Darren.Danyluk at sd6.bc.ca> wrote:> It sounds like she is working with the very basics of this software, > and her task is to write the code which would result in the > extraction of "odd" data from a dataset of restaurant sales.Not a native English speaker here; what exactly do you mean by "odd" in this case? If I ignore the "subject" field, it looks like your daughter should be looking for outlier detection methods. For example, https://rseek.org/ offers some good results for "outlier detection". -- Best regards, Ivan
On 03/03/2019 3:44 a.m., Ivan Krylov wrote:> Hi Darren, > > On Sat, 2 Mar 2019 22:27:55 +0000 > Darren Danyluk <Darren.Danyluk at sd6.bc.ca> wrote: > >> It sounds like she is working with the very basics of this software, >> and her task is to write the code which would result in the >> extraction of "odd" data from a dataset of restaurant sales. > > Not a native English speaker here; what exactly do you mean by "odd" in > this case?"Odd" numbers have a remainder of 1 when divided by 2; "even" numbers are multiples of 2. Duncan Murdoch> > If I ignore the "subject" field, it looks like your daughter should be > looking for outlier detection methods. For example, https://rseek.org/ > offers some good results for "outlier detection".