Hello everybody in Stackoverflow. I am a newbie R user, and having problem with lapply function.
Now I am using R version 3.0.1 (2013-05-16) -- "Good Sport" running on Ubuntu server 12.04.2 LTS.
My problem is I can't use lapply function to convert the output from searchTwitter (in twitteR) to data frame.
I can gather the tweet into 'tweet' variable, but can't convert to the data frame.
My code:
require(twitteR)
require(RJSONIO)
load('cred.Rdata')
registerTwitterOAuth(cred)
tweet <- searchTwitter('bus')
tweet1 <- lapply(tweet, as.data.frame) //error here
df <- do.call("rbind",tweet1)
write.csv(df,file='oneearthquake.csv')
I got the error:
Error in data.frame(text= "(tweet text)")
arguments imply differing number of rows: 1,0
I have tried on another Ubuntu server which running the same R version, it can run with out any warning. Could please tell me the way to solve this error?
Thank you in advance
Ploy