[R] header

John Kane jrkrideau at yahoo.ca
Fri Oct 19 15:48:37 CEST 2007

I'm no expert in R but I think that read.table simply will not start a variable with a numeric.  If you really want
the names to be as listed below you can assign them after import by using :

names(mydata) <- c(name, "20_1_TT_Z_e4" "20_2_TT_Z_e4")

name is a factor as far as I can see because that is the default in your R-profile  
See http://finzi.psych.upenn.edu/R/Rhelp02a/archive/98227.html  for more details

name's mode is numeric because the underlying form of a factor is numeric.

do str(mydata) for a bit more information

----- Original Message ----
From: Neuer Arkadasch <neuer_arkadasch at yahoo.de>
To: Neuer Arkadasch <neuer_arkadasch at yahoo.de>; r-help at stat.math.ethz.ch
Sent: Friday, October 19, 2007 9:30:38 AM
Subject: Re: [R] header

Maybe I had to write that the original data what I read are
   name 20_1_TT_Z_e4 20_2_TT_Z_e4
     A1           102            22
   A2           103            21
   A3           107            20
  Thatk you!

Neuer Arkadasch <neuer_arkadasch at yahoo.de> schrieb:
    Hi everyone, I read the following data
  > setwd("d:/")
> mydata <- read.table("mydata.txt", header=T)
> attach(mydata)
> mydata
  name X20_1_TT_Z_e4 X20_2_TT_Z_e4
1   A1           102            22
2   A2           103            21
3   A3           107            20
> name
[1] A1 A2 A3
Levels: A1 A2 A3
  > mode(name)
[1] "numeric"
Why name is a factor and numeric?  and why I do have X before the
 variable namin X20_1_TT_Z_e4? Is it possbile to have it as 20_1_TT_Z_e4 ?
  Ihre erste Baustelle? Wissenswertes für Bastler und Hobby

Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker. 
    [[alternative HTML version deleted]]

-----Inline Attachment Follows-----

R-help at r-project.org mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

      Ask a question on any topic and get answers from real people. Go to Yahoo! Answer

More information about the R-help mailing list