Skip to content

processing log file

3 messages · Jabez Wilson, David Winsemius, Karl Ove Hufthammer

#
On Nov 13, 2009, at 6:03 AM, Jabez Wilson wrote:

            
You were almost there. Just use lapply on the list object you produced:

 > lapply(apply(table.users, 2, FUN=table), length)
$Date
[1] 3

$UserName
[1] 5

$Machine
[1] 4

Or if you want the individual items that you requested:

 > lapply(apply(table.users, 2, FUN=table), length)$UserName
[1] 5
 > lapply(apply(table.users, 2, FUN=table), length)$Machine
[1] 4
#
On Fri, 13 Nov 2009 11:03:31 +0000 (GMT) Jabez Wilson
<jabezwuk at yahoo.co.uk> wrote:
Use the 'plyr' package:

library(plyr)
ddply(table.users, .(Date), summarise,
  users=length(unique(Username)),
  machines=length(unique(Machine)))