Skip to content
Prev 79147 / 398502 Next

how to import such data to R?

Dear ronggui,

I didn't find any attachments, but using the data lines in your
message, and assuming that . represents missing data, the following
appears to do what you want:

as.data.frame(scan("c:/temp/ronggui.txt", 
    list(year=1, apps=1, top25=1, ver500=1, 
        mth500=1, stufac=1, bowl=1, btitle=1, finfour=1, lapps=1,
d93=1, 
        avg500=1, cfinfour=1, clapps=1, cstufac=1, cbowl=1, cavg500=1,
 
        cbtitle=1, lapps_1=1, school="", ctop25=1, bball=1, cbball=1,),
        na.strings="."))

See ?scan for details.

I hope this helps,
 John

On Sat, 15 Oct 2005 15:57:42 +0800
ronggui <042045003 at fudan.edu.cn> wrote:
--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/