Re: [R] Apply() on columns

2012-06-25 Thread Rui Barradas
Hello, again. Sorry, I've used 'sum' when it should be 'mean'. Rui Barradas Em 25-06-2012 12:49, Rui Barradas escreveu: Hello, It's not that complicated. f <- function(index, dat, offset=5){ x <- data.frame(Emp=dat[, index], Hours=dat[, index + offset]) aggregate(Hours~Emp, data=

Re: [R] Apply() on columns

2012-06-25 Thread Rui Barradas
Hello, It's not that complicated. f <- function(index, dat, offset=5){ x <- data.frame(Emp=dat[, index], Hours=dat[, index + offset]) aggregate(Hours~Emp, data=x, sum) } sp <- read.table("supermarkt.txt") lapply(1:5, f, sp) Also, please provide context. (Quote the post you

Re: [R] Apply() on columns

2012-06-25 Thread Petr PIKAL
> > I do now know how to navigate through the table. > But my question is, what kind of graphical and numerical summaries can I > make with keeping in mind that I am interested in the average working hour > per employee? Rather vague question without data or code, so rather vague answer. For nu

Re: [R] Apply() on columns

2012-06-25 Thread faelsendoorn
I do now know how to navigate through the table. But my question is, what kind of graphical and numerical summaries can I make with keeping in mind that I am interested in the average working hour per employee? -- View this message in context: http://r.789695.n4.nabble.com/Apply-on-columns-tp4633

Re: [R] Apply() on columns

2012-06-20 Thread Petr PIKAL
Hi > Hi, > > Yes, the columns are related: V1 is related to V6, V2 is related to V7 and > so on. The columns V1,V2,V3,V4,V5 contains the number of employees (in a > filling team). The columns V6,V7,V8,V9,V10 contains the number of worked > hours of the filling team. You shall rather include y

Re: [R] Apply() on columns

2012-06-20 Thread John Kane
a grouped boxplot John Kane Kingston ON Canada > -Original Message- > From: f.a.elsendo...@gmail.com > Sent: Tue, 19 Jun 2012 22:25:31 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] Apply() on columns > > Hi, > > Yes, the columns are related: V1

Re: [R] Apply() on columns

2012-06-20 Thread faelsendoorn
Hi, Yes, the columns are related: V1 is related to V6, V2 is related to V7 and so on. The columns V1,V2,V3,V4,V5 contains the number of employees (in a filling team). The columns V6,V7,V8,V9,V10 contains the number of worked hours of the filling team. What I am interested in is the average workin

Re: [R] Apply() on columns

2012-06-19 Thread John Kane
is one expected to do with the data? John Kane Kingston ON Canada > -Original Message- > From: f.a.elsendo...@gmail.com > Sent: Tue, 19 Jun 2012 01:29:26 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] Apply() on columns > > Hi, > > It wasn't

Re: [R] Apply() on columns

2012-06-19 Thread faelsendoorn
Hi, It wasn't my purpose to quote the assignment here, but since my example is crappy I will. So I'am a manager of a supermarket and interested in the average working hours per employee. At http://www.mijnbestand.nl/Bestand-6Z8PB7VNSUHZ.txt this link you can find the dataset. The dataset contai

Re: [R] Apply() on columns

2012-06-15 Thread Peter Ehlers
On 2012-06-15 01:09, faelsendoorn wrote: Hi, I have some trouble with the following: I have a table of 7 rows and 6columns. The columns 1,2,3 have information about the number of employees. The columns 4,5,6 have information about the number of working hours. Each row, is corresponding with a we

Re: [R] Apply() on columns

2012-06-15 Thread R. Michael Weylandt
Just to take a stab at it, I'd suggest you don't actually need apply() and could simply get what you need with hist(DATA[,4:6]) if your data is as described. Michael On Fri, Jun 15, 2012 at 7:23 AM, Jean V Adams wrote: > Frans, > > I'm not sure I understand what you're after. > > I suggest tha

Re: [R] Apply() on columns

2012-06-15 Thread Jean V Adams
Frans, I'm not sure I understand what you're after. I suggest that you share a small example data set, using dput(). Then give an example of what you want the output to look like. Jean faelsendoorn wrote on 06/15/2012 03:09:41 AM: > Hi, > > I have some trouble with the following: I have a t

[R] Apply() on columns

2012-06-15 Thread faelsendoorn
Hi, I have some trouble with the following: I have a table of 7 rows and 6columns. The columns 1,2,3 have information about the number of employees. The columns 4,5,6 have information about the number of working hours. Each row, is corresponding with a week. My goal is to make a boxplot, histogra