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 have a text file holding my data instead of the data being pasted as the example has it. My text file is below:
#"test.table.1.0" file has this contents:
id Source
1 A10
2 A32
3 A10
4 A25
I tried this following the example
test_table <- read.table(textConnection("test.table.1.0"))
I can see that the problem is that textConnection is supposed to take a character vector, and I'm giving it a data.frame, but converting it via as.character also fails. Ultimately, I want to run a query like this:
sqldf("select test_table.source from test_table");