Hello, I have a list with gene names, fold changes (=expression level) and chromosomes. Names fold change chromosome hz 1.5 2 If I plot fold change versus chromosome (or vice versa): plot (ch, fc) I see only the chromosomes with numbers but not those with letter (x and y). What can I do? A second question: How can I add a single line in that plot at a certain y-level. Thanks Hermann [[alternative HTML version deleted]]
The answer to your question probably lies in your data. If you follow the instructions at the footer of every email on this list and provide an example that we can run (reproducible), we will be able to do more than guess. http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example In particular note the recommendation to use the dput function to send us sample data. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Hermann Norpois <hnorpois at googlemail.com> wrote:>Hello, > >I have a list with gene names, fold changes (=expression level) and >chromosomes. > >Names fold change chromosome >hz 1.5 2 > > >If I plot fold change versus chromosome (or vice versa): > >plot (ch, fc) > >I see only the chromosomes with numbers but not those with letter (x >and >y). What can I do? > >A second question: >How can I add a single line in that plot at a certain y-level. > >Thanks >Hermann > > [[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.
On Sep 10, 2012, at 9:14 AM, Hermann Norpois wrote:> Hello, > > I have a list with gene names, fold changes (=expression level) and > chromosomes. > > Names fold change chromosome > hz 1.5 2 > > > If I plot fold change versus chromosome (or vice versa): > > plot (ch, fc) >Your question is ambiguous. You have shown the layout with names that are not valid column names. You may want to use barplot() rather than plot(), since your x-values are discrete.> I see only the chromosomes with numbers but not those with letter (x and > y). What can I do? > > A second question: > How can I add a single line in that plot at a certain y-level.If you do not want barplot() then look at dotplot(). -- David Winsemius, MD Alameda, CA, USA
> -----Original Message----- > I have a list with gene names, fold changes (=expression > level) and chromosomes. > > Names fold change chromosome > hz 1.5 2 > > > If I plot fold change versus chromosome (or vice versa): > > plot (ch, fc) > > I see only the chromosomes with numbers but not those with > letter (x and y). What can I do?Make sure your chromosome column is a factor or character vector.>From your description so far, I deduce that it is numeric (you can check by saying class(chromosome) ). I am guessing that R has been told to convert chromosome to numeric. If so, R would convert X and Y to NA (that is, missing) in the process - with a warning that ought to have been obvious - because they are not numbers. That would explain why you aren't seeing them in the plot.How you got that I don't know; the default would be to import as factor. Anyway, once you have chromosome properly imported as character or factor you can use barplot with chromosome used as labels, or plot(1:length(fc), axes=FALSE) and then add axes using axis(1, at=1:length(fc)), labels=chromosome) #or similar and axis(2)> How can I add a single line in that plot at a certain y-level.see ?abline> > Thanks > Hermann > > [[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. >******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}