[R] write & read object from mysql

Gottfried Gruber ggruber at terminal.at
Sun Mar 26 12:50:58 CEST 2006


i want to store an lm-object in mysql and use the following command:

dbSendQuery(con,paste("INSERT INTO tablename 
(id,name,result,result_txt,rsquared) VALUES 

z1 is the lm-object
z2 is just as string

i try to read it back: v=dbReadTable(con,"tablename")

but i think the binary is stored wrong in the database and the text is too 
the binary stops on the first \n
the text is too long. when i try to read it back i get dbi internal error 
field truncated.

in the end it is not possible to restore the object with unserialize.

please help me to write & read the object correctly.

thank & best regards,
Gottfried Gruber
mailto:gottfried.gruber at terminal.at
www: http://gogo.sehrsupa.net

More information about the R-help mailing list