Skip to content

Programcode and data in the same textfile

1 message · Hotz, T.

#
Following up on Thorsten's solution, this one doesn't need a tempfile:

my.data<-read.table(textConnection(c(

      ### here comes my data

      "Sex    Respons",
      "Male   1",
      "Male   2",
      "Female 3",
      "Female 4"

      ### end of data input

)),header=T)

print(my.data)

HTH

Thomas
---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976