How to convert searchTwitter results (from library(twitteR)) into a data.frame?

Posted by analyticsPierce on Stack Overflow See other posts from Stack Overflow or by analyticsPierce
Published on 2010-06-16T18:34:35Z Indexed on 2010/06/16 18:42 UTC
Read the original article Hit count: 146

Filed under:
|
|

I am working on saving twitter search results into a database (SQL Server) and am getting an error when I pull the search results from twitteR.

If I execute:

library(twitteR)
puppy <- as.data.frame(searchTwitter("puppy", session=getCurlHandle(),num=100))

I get an error of:

Error in as.data.frame.default(x[[i]], optional = TRUE) : 
  cannot coerce class structure("status", package = "twitteR") into a data.frame

This is important because in order to use RODBC to add this to a table using sqlSave it needs to be a data.frame. At least that's the error message I got:

Error in sqlSave(localSQLServer, puppy, tablename = "puppy_staging",  : 
  should be a data frame

So does anyone have any suggestions on how to coerce the list to a data.frame or how I can load the list through RODBC?

© Stack Overflow or respective owner

Related posts about r

    Related posts about twitter