lines='Number_Saying_Yes Frequency 0 30 1 56 2 73 3 41' con = textConnection( lines ) DF = read.table( con, header=TRUE ) close(con)