[R] Query about data manipulation
lalitha viswanath
lalithaviswanath at yahoo.com
Thu Mar 1 17:34:19 CET 2007
Hi
Thanks much for the prompt response to my earlier
enquiry on packages for regression analyses.
Along the same topic(?), I have another question about
which I could use some input.
I am retreiving data from a MySQL database using
RODBC.
The table has many BLOB columns and each BLOB column
has data in the format
"id1 \t id2 \t measure \n id3 \t id4 \t measure...."
(i.e. multiple rows compressed as one long string)
I am retreiving them as follows.
dataFromDB <- sqlQuery(channel, "select
uncompress(columnName) from tableName");
I am looking for ways to convert this long "string"
into a table/dataframe in R, making it easier for
further post processing etc without reading/writing it
to a file first.
Although by doing write.table and reading it in again,
I got the result in a data frame, with the \t and \n
interpreted correctly, I wish to sidestep this as I
need to carry out this analyses for over 4 million
such entries.
I tried
write.table(dataFromDB, file="FileName");
dataFromFile <- read.table(FileName, sep="\t")
dataFromFile is of the form
92_8_nmenA 993_7_mpul 1.042444
92_8_nmenA 3_5_cpneuA 0.900939
190_1_rpxx 34_4_ctraM 0.822532
190_1_rpxx 781_6_pmul 0.870016
Your input on the above is greatly appreciated.
Thanks
Lalitha
____________________________________________________________________________________
Never miss an email again!
More information about the R-help
mailing list