I\'m trying to read a text file into R so I can use the sqldf functions. I\'m following this example, https://stat.ethz.ch/pipermail/r-help/2008-January/152040.html, but I
Aniko's comment has almost all you need (along with header=TRUE
):
R> data <- read.table("test.table.1.0", header=TRUE)
R> data
id Source
1 1 A10
2 2 A32
3 3 A10
4 4 A25
R>
In other words, if you have the data in a file, read from a file. A textConnection is useful if and when you have the data 'right there' along with the command as in the email you referenced.