[R] Fwd: Need some assistance in plotting distributions

Frede Aakmann Tøgersen frtog at vestas.com
Tue Jul 8 12:56:02 CEST 2014


Well

plot(density(a$frequency), col = "blue")

lines(density(b$frequency), col = "green")

Where a is as Jim defined it and b similar from the other data file.


Yours sincerely / Med venlig hilsen


Frede Aakmann Tøgersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling

Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com

Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender. 

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Vivek Das
> Sent: 8. juli 2014 12:38
> To: jim holtman
> Cc: R help
> Subject: Re: [R] Fwd: Need some assistance in plotting distributions
> 
> Dear Jim,
> 
> Thank you for replying to my query. Both the files contains tumor
> mutational frequencies. The LG_freq contains the entire mutational
> landscape and the HIPS2_freq contains mutational frequency of one clone. I
> want to see how both the frequency curve are behaving in one plot. Is that
> possible to see in one plot with different colors to distinguish the
> frequency distribution of both files in one image where I can see both the
> plots. I have tried density plot but could not figure out how to add the
> next frequency distribution file to the same plot and see the difference in
> both the plots in one image with different colors. Can this be done?
> 
> ----------------------------------------------------------
> 
> Vivek Das
> 
> 
> 
> On Tue, Jul 8, 2014 at 12:19 PM, jim holtman <jholtman at gmail.com> wrote:
> 
> > Have you tried the density function:
> >
> > > a <- read.table('/users/jim/downloads/LG_freq.txt',header = TRUE)
> > > str(a)
> > 'data.frame':   669 obs. of  2 variables:
> >  $ Position : Factor w/ 669 levels "chr1_103381212",..: 308 463 458 160
> > 393 457 165 464 3 467 ...
> >  $ frequency: num  75 62.5 50 48.9 47.1 ...
> > > plot(density(a$frequency))
> > >
> >
> >
> >
> > Jim Holtman
> > Data Munger Guru
> >
> > What is the problem that you are trying to solve?
> > Tell me what you want to do, not how you want to do it.
> >
> >
> > On Tue, Jul 8, 2014 at 4:30 AM, Vivek Das <vd4mmind at gmail.com> wrote:
> >
> >> Dear Users,
> >>
> >> I need some assistance in plotting some distribution enrichments, like I
> >> have files with some frequency values, now I want to plot plot the
> >> distribution of those frequencies for one sample and then on the same
> plot
> >> I want to plot the next samples where the frequency comes from another
> >> file. Can you tell me which command to use? I would like to see the
> >> distribution both in curve and histrogram format. Even if the frequency
> >> are
> >> not normally distributed I would like to see to what extent they are
> >> distributed and how much they are deviated from the normal distribution.
> >> However I would expect a Gaussian curve but due to the low frequency in
> >> LG_freq it would be not evident. Can you share some snippets for that?
> Am
> >> attaching the two files, can you please guide me how to do it, I tried
> >> with
> >> the plot function but I was unable to do, I read somewhere it was possible
> >> to do with plot function with type 'L' but am unable to do that. I would
> >> need some assistance in this. Thanks
> >>
> >>
> >>
> >> ----------------------------------------------------------
> >>
> >> Das
> >>
> >> ______________________________________________
> >> R-help at 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]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list