Re: [R] Functions Accessing Databases

2009-04-03 Thread bartjoosen
Hi, There seems to be something wrong with your function getinfo. Try first to substitute your dbGetQuery by a print statement, so that you can see what is going on: getinfo=function(t){print(the SQL query)} allinfo=sapply(c(1985:2007),getinfo) If these results look good, you can change your fu

[R] Functions Accessing Databases

2009-04-02 Thread Bob Roberts
Hello, I'm accessing a MySQL database from inside R and had a problem with a function. In the database, there is data from years 1985 to 2007 that I would like to retrieve. I can easily get the data from one year by the following: info1985=dbGetQuery(con, statement='the SQL query') Inside the