tmp <- textConnection( "day A B 0 10.0 10.0 7 9.0 9.1 14 8.0 8.2 21 7.0 7.3 28 6.0 6.4 35 5.0 5.5 42 4.0 4.5 49 3.0 3.6 56 2.0 2.7") x <- read.table(tmp, header=TRUE) close.connection(tmp) head(x)