lines = 'Weight Cholesterol 168 135 175 403 173 294 158 312 154 311 214 222 176 302 262 269 181 311 143 286 140 403 187 244 163 353 164 252' con = textConnection( lines ) DF = read.table( con, header=TRUE ) close(con)