[R] Re ad Table

jim holtman jholtman at gmail.com
Tue Jul 1 00:45:40 CEST 2008


Your sample works just fine:

> x <- read.table(textConnection("Name  Heigth
+ W1     22
+ W2     45"), header=TRUE, row.names=1)
> closeAllConnections()
>
> x
   Heigth
W1     22
W2     45
>

Take a look at your data file.  You might have some lines with a
different number of fields.

On Mon, Jun 30, 2008 at 12:27 PM, HansImGlück <vikunja at gmx.net> wrote:
>
> Hi all,
>
> I have a problem with the function "read.table"
>
> I have a text file wich I want to analyse in R
>
> Example:
> Name  Heigth
> W1     22
> W2     45
>
> Expression:
>> parameters.W.df <- read.table("parameters.W.txt", header=TRUE,
>> row.names=1)
>
> What I get back:
> Error in scan, line 1 has not 11 elements
>
> What should I try to slove the problem?
>
> Thanks
>
> --
> View this message in context: http://www.nabble.com/Read-Table-tp18199273p18199273.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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list