[R] a quick ? on using read.table()

From: Yong Wang <wang_at_galton.uchicago.edu>
Date: Fri 13 May 2005 - 04:19:23 EST

Dear all

I have a data set like following



name ticker price # how to specify attributes for differet colums
a     ta     1
a     ta     1
a     ta     1
name ticker price 	# the extra headline is a problem
a     ta     1
a     ta     1
b            2
b            2
b            2
b            2
b            2
c     tc     3
c     tc     3
name ticker price
c     tc     3
c     tc     3
c     tc     3

**************************

all columns are read in as "factor", if without specifying parameters in read.table()
so how can I use read.table() function and its parameter to conveniently do following things in ONE action

if can not, answer for the first and second question is especially appreciated.
I did not figure out how to use "as.is"

  1. specify the each row with different addtribute, e.g., the first colum as"character" second col as "factor", third one as "numeric"
  2. remove extra headlines
  3. remove rows with blanks

thank you
regards



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri May 13 04:36:40 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:45 EST