[R] add a curve that fits the highest values on the plot.

2011-06-12 Thread ads pit
Hi everyone, I am given two vectors - for example - x= c(0:20) > x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 and > y [1] 19.4 17.9 8.1 11.3 7.8 8.0 5.0 1.7 3.9 5.4 7.5 5.4 4.7 5.0 4.9 [16] 3.5 2.9 2.4 1.4 1.7 > plot(x,y,xlim=range(x),ylim=range(y))

[R] return counts of elements on a table column depending on elements on another column

2011-06-08 Thread ads pit
Hi, I am given the following table: > head(hsa_refseq) chr genome regionstart stop nu strand nu.1nu.2 gene_id 1 chr1 hg19_refGeneCDS 6742 6751 0 +0 gene_id NM_032291 2 chr1 hg19_refGene exon 66999825 6751 0 +. gene_id NM_032291 3 chr1 hg19_

[R] write gene_id in a bed file

2011-06-07 Thread ads pit
Hi all, I have build the following data frame head(href) chr tx_start tx_end g_id strand cds_start cds_end exon_count 1 chr1 8384389 8404227 NM_001080397 + 8384389 8404073 8 2 chr1 16767166 16786584 NM_001145277 + 16767256 16785491 7 3 chr1 16767166

[R] extract data from a data frame field

2011-06-06 Thread ads pit
Hi all, I am given the a data frame in which one of the columns has more information together- see column 4, peak_loc: chr startend peak_loc cluster_TC strand peak_TC 1 chr1 564620 564649 chr1:564644..564645,+ 94 + 10 2 chr1 565369 565404 chr1:565371..565372,+