Hi Maxim,
Yes, it is possible.
Please review the information here:
http://www.statmethods.net/management/subset.html
In short, you need to read in your file at one chunk (maybe using
read.table) and then subset and plot it however you want.
If this was a bigger job I would send you to learn the plyr package, but for
what you describe it shouldn't be necessary.
Good luck,
Tal
<http://www.statmethods.net/management/subset.html>
----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com/ (English)
----------------------------------------------------------------------------------------------
On Thu, Dec 10, 2009 at 4:40 PM, Maxim <deeepersound@googlemail.com>
wrote:
> Hi,
>
>
> I'm stuck with parsing data into R for heatmap representation.
>
>
> The data looks like:
>
> 1 id1 x1 x2 x3 .... x20
>
> 2 id1 x1 x2 x3 .... x20
>
> 3 id1 x1 x2 x3 .... x20
>
> 4 id1 x1 x2 x3 .... x20
>
> .........
>
> 348 id2 x1 x2 x3 .... x20
>
> 349 id2 x1 x2 x3 .... x20
>
> 350 id2 x1 x2 x3 .... x20
>
> 351 id2 x1 x2 x3 .... x20
>
> .........
>
>
>
> The data is sorted for the IDs (id1,id2 .....id40) and I like to produce 40
> heatmaps thereof, 1 heatmap per data corresponding to a single ID. The
> data
> that has to be plotted is 20 values (x1 to x20). There is different amounts
> of data for respective IDs. In the end I'd like to have the 40 heatmaps
> stacked on top of each other sorted by ID and heatmap heights according to
> the amount (number of rows) of data. Unfortunately the individual data
> lines
> have to be sorted with respect to the maximum of the values X1 to x20 in
> individual rows. Actually this not that important as I guess this might be
> easier to realize in upstream Perl scripts producing the data.
>
>
> The data is available as data per ID in individual files or as a sorted
> file
> with the complete dataset (as shown above).
>
>
> Is it possible in R to break a file as above into distinct blocks
> (depending
> on ID) and then to process it (sorting according to maximum, heatmap)?
>
>
> Which commands do I have to issue for the manipulation of the data.frame? I
> tried the
>
>
> I'd be glad if someone could help me finding the correct direction to
> solve
> my problem!
>
>
> Best regards
>
>
> Maxim
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]