[R] R error- "more columns than column names"
David Winsemius
dwinsemius at comcast.net
Thu Feb 25 01:18:46 CET 2010
On Feb 24, 2010, at 7:07 PM, Euphoria wrote:
>
> Thanks to all who posted. After trying all of the above-listed
> options - the
> error is still popping up, but here is some progress:
>
> 1) I can read in the file just fine when I use the read.table
> statement and
> specify it as a tab delimited file using the code:
>
> two <- read.table("Z:/CCFPhenotypesTAB.dat", head=TRUE, sep="\t")
>
> But, my issue is with GenABEL and the load.gwaa.data statement - I
> need the
> file to be read into load.gwaa.data - unless there is another way to
> read in
> the phenotype file in GenABEL.
>
> Code:
> mix <- load.gwaa.data (phe = "Z:/CCFPhenotypesTAB.dat", gen =
> "pedmap-0.raw")
The first line of that function body is this:
dta <- read.table(phenofile, header = TRUE, as.is = TRUE)
Notice that no provision was made for a supplied sep argument. Hack it
so that it recognizes tab characters. Just changing hte extension
designation will not allter the fact that iwas not designed to work
with "tab" as a separator.
Perhaps this as a replacement:
dta <- read.table(phenofile, header = TRUE, as.is = TRUE, sep="\t")
Or give the argument list a set of ellipses , ...) and the above line
some ellipses to receive the argument.
--
David.
>
>
> 2) Also, it might help if I explained how I came about the .dat
> file. It
> was originally created in excel as a .xlsx file, which I converted
> to a tab
> delimited .txt file. I just changed the .txt extension to .dat for
> it to be
> read in R for the GenABEL package.
>
> --
> View this message in context: http://n4.nabble.com/R-error-more-columns-than-column-names-tp1568052p1568313.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
More information about the R-help
mailing list