Hi, I am importing dataframe from an Excel file (xlsx package). The columns contain acutally measurements for single species and the column-length is of variable. As it is imported as a dataframe the difference to the "longest" column is filled with NA. To explain it with an example, my dataframe looks like:
A <- seq(1:10) B <- c(seq(1:5),rep(NA,5)) C <- c(seq(1:7),rep(NA,3)) df <- data.frame(A,B,C) Now I'd like to transform that to a list of vectors of different length. Therefore I need to remove the NAs collectively from the single columns...I tried for transforming: as.list(df) ...but I don't know how can I remove the NAs now? as.list doesn't take na.rm=TRUE argument. Is there any ready function to perform such tasks? Or is there a better way then to assign the data to a list of vectors with variable length? /johannes -- ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.