Re: [R] Unequal column lengths

2016-04-15 Thread John Kane
3rd Qu.:7.0 3rd Qu.:6 3rd Qu.:6.00 Max. :9.0 Max. :7 Max. :9.00 NA's :2 NA's :1 John Kane Kingston ON Canada > -Original Message- > From: t...@vims.edu > Sent: Thu, 14 Apr 2016 21:33:31 + > To: r-help@r-project.org > Subje

Re: [R] Unequal column lengths

2016-04-14 Thread Jim Lemon
Hi Tom, What you want is a list rather than a data frame. So: df<-read.table(text=" Dat1 Dat2 Dat3 1154 2779 3335 42 NA 5 59 NA NA", header=TRUE) dflist<-as.list(df) na.remove<-function(x) return(x[!is.na(x)]) sapply(dflist,na.remove) Jim

Re: [R] Unequal column lengths

2016-04-14 Thread David Winsemius
> On Apr 14, 2016, at 2:33 PM, Tom Mosca wrote: > > Hello, > > I�ve tried several times to learn R, but have never gotten past a particular > gate. My data are organized by column in Excel, with column headers in the > first row. The columns are of unequal lengths. I export

[R] Unequal column lengths

2016-04-14 Thread Tom Mosca
Hello, I�ve tried several times to learn R, but have never gotten past a particular gate. My data are organized by column in Excel, with column headers in the first row. The columns are of unequal lengths. I export them as CSV, then import the CSV file into R. I wish to summarize the data