Displaying 2 results from an estimated 2 matches for "o_dur".
Did you mean:
ondur
2011 Jul 12
1
What's wrong with my code? (Edited version-added my data)
I've written out codes for one particular file, and now I want to generate
the same kind of graphs and files for the rest of similar data files.
For example, a file "8.csv" would look like such:
enc_callee inout o_duration type
A out 342 de
B in 234 de
C out 132 de
E in 111 de
A in 13 cf
H in 15.7 cf
G out 32 de
A out 32 cf
I in 14 de
K in 189 de
J out 34.1 cf
B in 98.7 de
H out 23 de
C out 43 cf
H in 567 cf
I out 12 de
E out 12 de
K out 12 cf
B in 1 cf
A out 29 de
D out 89 cf
J in 302 de
H in 12 cf
A in 153 cf...
2011 Jul 12
1
What's wrong with my code?
...g with
it...would you please help me? Thanks!
my.files <- list.files()
for (i in 1: length(my.files)) {
temp.dat <- read.csv(my.files[i])
eight <- read.csv(file="8.csv", header=TRUE, sep=",")
eightout <- subset(eight, inout=="Outgoing from panel hh" & o_duration>0,
select=c(inout, enc_callee, o_duration))
f <- function(eightoutf) nrow(eightoutf)
eightnocalls <- ddply(eightout,.(enc_callee),f)
colnames(eightnocalls)[2] <- "nocalls"
eightout$nocalls <- eightnocalls$nocalls [match(eightout$enc_callee,
eightnocalls$enc_callee)]
ei...