Re: [R] Reshaping dataframes

2012-08-23 Thread David Winsemius
On Aug 23, 2012, at 2:02 AM, Ingmar Schuster wrote: Thanks Rui! Anybody with ideas regarding filling _while_ binding data frames instead of afterwards? Not sure what you mean by " _while_ binding dataframes" but the original question seems answered by this sentence from the help file

Re: [R] Reshaping dataframes

2012-08-23 Thread Ingmar Schuster
Thanks Rui! Anybody with ideas regarding filling _while_ binding data frames instead of afterwards? Ingmar 2012/8/22 Rui Barradas > Hello, > > Your function doesn't seem to be very difficult to generalize. > > d <- read.table(text=" > >trg_type child_type_1 > 1 Scientists NA > 2of

Re: [R] Reshaping dataframes

2012-08-22 Thread Rui Barradas
Hello, Your function doesn't seem to be very difficult to generalize. d <- read.table(text=" trg_type child_type_1 1 Scientists NA 2of used ", header=TRUE) str(d) subs_na <- function(tok, na_factor_level = "NOT_REALIZED", na_num = 9) { ifac <- which(sapply(tok, is.fac

[R] Reshaping dataframes

2012-08-22 Thread Ingmar Schuster
Hi, I have a data set with variables that are _not_ missing at random. Now I use a package for learning a Bayesian Network which won't accept NA as a value. From a database I query data.frames with k,k+n,k+2n, ... variables (there are always at least k variables as leftmost columns). Using rbind.f