Hello kind and R-knowledgeable souls!

I am trying to use read.fortran to read in old datasets in 80-column-card 
format 
with no separators between variables (just 80 columns of solid digits).
I comprehend the instructions for specifying the columns for each variable, but 
I can't understand how to assign the variable names after reading the help 
pages 
for read.fortran, read.fwf and read.table.

I tried putting a col.names section in the read.fortran statement:

AN35 <-data.frame(read.fortran(filename,c("I9","4I2","2I1","3I2","I1","16I2",
"I1","I5","I1","I3","I2",  "A4","3A1","A2","A1"),
  header = FALSE,skip=0,sep="@",
  col.names = 
paste(idno,empmo,empyr,birthmo,birthyr,sex,race,teno,testmo,testyr,
     testtyp,L500,L1k,L2k,L3k,L4k,L6k,L8k,RT1k,R500,R1k,R2k,R3k,R4k,R6k,R8k,
     HPD,dept,shift,TWA,envclas,jobcode,hobby.med.STS,audclas,disp),
  row.names = (idno) ))


I also tried a separate dimnames statement like so:

dimnames(AN35)[[2]] <- 
c("idno","empmo","empyr","birthmo","birthyr","sex","race",
    
"teno","testmo","testyr","testtyp","L500","L1k","L2k","L3k","L4k","L6k","L8k","RT1k",

    "R500","R1k","R2k","R3k","R4k","R6k","R8k","HPD","dept","shift","TWA",
    "envclas","jobcode","hobby","med","STS","audclas","disp")


I copied this from some documentation but I have no clue what the [[2]]  means.

If anyone has one good example that would help me a lot!
Thanks in advance!
Julie
        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to