Re: [R] For loop on column names

2014-01-18 Thread Bert Gunter
s(mydf)) > print((percent(length(is.null(mydf [, cname]) / lines)) > > Br. Frede > > > Oprindelig meddelelse ---- > Fra: Jeff Johnson > Dato:18/01/2014 02.10 (GMT+01:00) > Til: R help > Emne: [R] For loop on column names > > I'm trying to

Re: [R] For loop on column names

2014-01-18 Thread Frede Aakmann Tøgersen
Hi Try for (cname in colnames(mydf)) print((percent(length(is.null(mydf [, cname]) / lines)) Br. Frede Oprindelig meddelelse Fra: Jeff Johnson Dato:18/01/2014 02.10 (GMT+01:00) Til: R help Emne: [R] For loop on column names I'm trying to find a more efficient to calc

[R] For loop on column names

2014-01-17 Thread Jeff Johnson
I'm trying to find a more efficient to calculate the percent a field is populated and repeat it for each field (column). First, I'm counting the number of lines: lines <- as.integer(countLines(extract) - 1) dput(lines) 10L extract <- 'C:/Users/jeffjohn/Desktop/batchextract_100k_sample.csv' my