# [R] barplot beside=TRUE - values differ on scales

Wed Oct 12 18:55:59 CEST 2016

```Hi Adams,
The story I am trying to show visually relationship between GN and CN
for every column. Each column represents a patient. In each patient, a
particular chromosome region (CN) is either lost (-2 or -1) or gained
(1 or 2). Typically if loss (one copy loss - as humans have pair of
chromosome) or homozygous (two copies loss) theoretically indicate
decrease in number of copies of gene located in that region of
chromosome. The number of copies of a gene located in that chromosomal
regions are indicated by GN.
through this barplot, I intend to show that in 7 cases (columns) if a
relationship exist by plotting GN and CN next to each other.  If I log
values in GN, I am loosing the minor differences between cases in GN.
hope I could convince/explain.
thanks

On Wed, Oct 12, 2016 at 12:36 PM, Adams, Jean <jvadams at usgs.gov> wrote:
>
> What story are you trying to tell?  Or what question are you trying to
> answer by visualizing these data?  How is a bar plot of these numbers going
> to help?  I'm just wondering if perhaps a different visualization might make
> more sense, for example, a scatter plot of GN vs. CN.
>
> m <- structure(c(112L, 0L, 579L, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L,
>   528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN",
>   "CN"), c("DC5", "DC8", "DC14", "DC18", "DC19", "DC20", "DC23"
>   )))
> plot(m["GN", ], m["CN", ])
>
> Jean
>
>
> On Wed, Oct 12, 2016 at 11:20 AM, Adrian Johnson <oriolebaltimore at gmail.com>
> wrote:
>>
>> Dear group,
>> I have been struggling to barplot two different measurements from one
>> subject. These two measures differ in range.  I want to plot row 1
>> axis on left side and row 2 values on right side.
>>
>> For a given column I want to plot GN and CN next to each other.
>>
>> my dput code is below
>> :
>>
>> structure(c(112L, 0L, 579L, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L,
>> 528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN",
>> "CN"), c("DC5", "DC8", "DC14", "DC18", "DC19", "DC20", "DC23"
>> )))
>>
>>
>> As you can see:
>>    DC5 DC8 DC14 DC18 DC19 DC20 DC23
>> GN 112 579  131 2234 2892  528  582
>> CN   0   1    1    2    1    0    2
>>
>> GN values are range from 100 - 3000
>> while CN are always -2 or -1 or 0 or 1 or 2
>>
>> Also I cannot log GN values and plot because a difference in 100 units
>> also matters in my experiment.
>>
>> Any help would be greatly appreciated.
>>
>> Thanks
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help