detect points with almost
identical coordintes yourself and then change the color of the
respective plotting symbol.
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University
and ylim parameters of the plot function.
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics / MIPS Tel. +49-89-3187 3675
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
http://mips.gsf.de/staff/pagel
. Any hints are highly appreciated.
Thanks
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
85350 Freising, Germany
http://mips.gsf.de/staff/pagel
On Thu, Dec 14, 2006 at 06:25:49PM -0500, Duncan Murdoch wrote:
On 12/14/2006 5:05 PM, Philipp Pagel wrote:
My problem starts, when I want to put more than one series of data in
the plot and accordingly need one legend row per data series:
year1 = 2001
year2 = 2005
g1 = 1.9
g2 = 1.7
plot
['query2',], ...)
scaled_DB$dist3 = distancevector(scaled_DB, scaled_DB['query3',], ...)
...
top1 = scaled_DB[rank(scaled_DB$dist1)=5, ]
...
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
1, A, 24, The Red House
2, A, 25, King's Home, by the Sea
...
Is there a way i can specify to R that King's Home, by the Sea is one
word?
Yes: It needs to be quoted in the file:
2, A, 25, King's Home, by the Sea
cu
Philipp
--
Dr. Philipp PagelTel
calcualtions are done at full precision, though.
Example:
a=1/3
a
[1] 0.333
print(a)
[1] 0.333
print(a, digits=12)
[1] 0.
For more details have a look at ?print and also at ?options and search
for 'digits'.
cu
Philipp
--
Dr. Philipp Pagel
2221
9 9.1 5.9792 35.1629.11311 2221
read.table(file, skip = 10)
To me it looks like your data is in a fixed-width format. If that is the
case you should use read.fwf() instead of read.table().
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics / MIPS Tel
Goldberg
What Every Computer Scientist Should Know About Floating-Point Arithmetic
Computing Surveys, 1991
Reprints can be found in many places online - e.g. here:
http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pdf
cu
Philipp
--
Dr. Philipp Pagel
, replace=T)
y = sample(c(0,1), 100, replace=T)
z = sample(c(0,1), 100, replace=T)
# contingency table
mytab = table(x,y,z)
# flat contingency table
as.data.frame( mytab )
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics
I'd like to plot things with axes going from the
highest to the lowest value
You can use the xlim and ylim parameters of the plot function. E.g:
x = 1:100
plot(x, x^2) # normal
plot(x, x^2, xlim=c(100,0)) # reversed x axis
cu
Philipp
--
Dr. Philipp Pagel
?
Use merge()
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics
the option
'fill=TRUE' to tell read.table that you want it to silently pad short
rows with empty elements.
Another 'popular' reason for funny errors with read.table is the
unexpected occurence of quotation or comment characters in the data...
cu
Philipp
--
Dr. Philipp Pagel
%in% set, ]
SHCODE COUNTRY NAME WBCTRY X.1. X.2.
3 3 Benin BEN -+ NA
12 12 Congo COG -+ NA
26 26Mali MLI -+ NA
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented
. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics / MIPS Tel. +49-89-3187 3675
GSF
and find the figure in the
resulting directory.
I'm not sure if and how this works with the new odt format used by
openoffice now, but sxw will work.
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49
as photography-like. jpg images of plots tend to suffer from
bad artifacts...
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
On Fri, Jun 23, 2006 at 11:27:00AM -0500, Marc Schwartz (via MN) wrote:
On Fri, 2006-06-23 at 18:16 +0200, Philipp Pagel wrote:
On Fri, Jun 23, 2006 at 09:21:37AM -0400, Gabor Grothendieck wrote:
Note that jpg, bmp and png are in less desirable bit mapped formats
whereas
eps
example calculation you don't need a loop
at all:
x = runif(100)
y = x+1
z = x+y
d = data.frame(x,y,z)
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science
column of table X is a sub set of the first column of Y. I need to
find the matching rows in both tables by looking on their unique
identification at the first columns.
?merge
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented
(myhist$counts)
plot(myhist,main=NULL,border=TRUE,xlab=days,xlim=c(0,6),lty=2)
Not exactly clean, though -- we are messing with the myhist object...
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71
On Sun, Apr 16, 2006 at 12:26:29AM -0400, Luke wrote:
x - a, aab
y - a, aa, aab, aabc.
Is there any R function to get the indices of y for the elements of x, that
is, foo(x, y) will give me the index vector c(1, 3)?
match(x, y)
cu
Philipp
--
Dr. Philipp Pagel
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics / MIPS Tel. +49
On Fri, Apr 07, 2006 at 09:55:47AM +0200, Philipp Pagel wrote:
On Fri, Apr 07, 2006 at 02:58:00AM -0400, Brian Quinif wrote:
I tried this
years - Freshmen if i==1
years - Sophomores if i==2
What you are looking for is not an if clause but logical indexing:
years[years==Freshmen] - 1
(file=foo.RData, compress = True)
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute
0.09914006 0.8109087
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics
Now I want to select the best clustered class, how can I click on the data
point, and the program returns the index of that cluster(its class number,
or color number)?
Have a look at identify()
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute for Bioinformatics / MIPS Tel. +49-89-3187
On Tue, Mar 14, 2006 at 01:03:22PM +0100, Philipp Pagel wrote:
On Tue, Mar 14, 2006 at 12:55:47PM +0100, Arnau Mir Torres wrote:
All the outputs names are file.name.pdf but I want to put a different
name for each graphic.
you can use paste() to put together the command:
file =foo
or perl an then
just read the table with R.
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
1.1024
321 70.05932.1502
...
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
and
Institute
On Sun, Mar 05, 2006 at 12:00:19AM +, christophe tournayre wrote:
Is it possible to create a semilog plot in R?
If you mean a plot with one log-scale axis this is what you want:
x = 1:100
y = x^2
plot(x,y, log=y)
See ?plot for details
cu
Philipp
--
Dr. Philipp Pagel
have
some kind of separator in your file...
cu
Philipp
--
Dr. Philipp PagelTel. +49-8161-71 2131
Dept. of Genome Oriented Bioinformatics Fax. +49-8161-71 2186
Technical University of Munich
Science Center Weihenstephan
85350 Freising, Germany
:200
i - sample(1:200, 100)
s1 - a[i]
s2 - a[-i]
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter
on the
canvas or open a new device whenever you want a new window.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/~pagel
is trying to be smart about labels getting too close/overlap. Specify the
graph to be a little wider and the labels will appear.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF
will give you something like this:
as.data.frame(tbl)
b Freq
1 (0,20] 17
2 (20,40] 28
3 (40,60] 19
4 (60,80] 15
5 (80,100] 21
Is that what you wanted?
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
http://mips.gsf.de/~pagel
can also add 'quote=FALSE'
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
Brown
9 14 Red Green
10 14 Red Hazel
11 17 Red Blue
12 26 Red Brown
13 16 Blond Green
14 10 Blond Hazel
15 94 Blond Blue
16 7 Blond Brown
Also have a look at reshape().
cu
Philipp
--
Dr. Philipp PagelTel. +49-89
C3 8
D4 7
E5 6
A1 9 99
B1 10 98
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter
usefull: Finally R would be capable of
producing the wealth of chartjunk other software has offered for
decades! Imagine using your corporate logo instead of boring circles or
dots for plotting! (OK ok - ouch - don't beat me, please...) ;-)
cu
Philipp
--
Dr. Philipp Pagel
placed correctly).
This routinely happens to me when using dev.copy2eps. If I use a
postscript device to begin with everything is fine.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187
the mean you will find
this handy:
apply(USArrests, 1, mean)
here you can substitute mean by whatever function you'd like to apply
to each row.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89
. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
a (short) example of what exactly you do, what error
messages and warnings you get and what your input file looks like.
BTW: read.table returns a data frame so I'm not sure what
you mean by using data.frame() later on.
cu
Philipp
--
Dr. Philipp PagelTel
tell us what the goal of all this
is and what commands you were using ...
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
the script on the same machine in both cases? I got burnt a
couple of times with different machines running different versions of
the OS, non-identical versions of shared libraries etc...
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute
but this sounds like a pretty simple barplot
to me.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse
is not much smaller than max-min you
may want to generate more numbers than you actually need so unique()
leaves you with more results and you don't have to iterate so often...
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics
does not work in text()) but using the cex option is a workaround:
plot(1:100, (1:100)^2)
text(10,1000, foo)
text(10,2000, foo, cex=2)
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187
in your plot. So you only
need to add some offset to your y-values and work out the x-positions:
y - c(10,12,15,8)
lab - c('*','**','***','*')
barplot(y, ylim=c(0,20), space=0.5)
x - (0:3*0.5)+1:4
text(x, y+1, lab, adj=0.5)
cu
Philipp
--
Dr. Philipp Pagel
to label.
Well, maybe you should use the x values returned by barplot (your
variable blocks) instead of computing x-positions yourself as I
originally suggested.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS
into the same graph.
Have a look at the documentation for plot(), line() and predict().
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
editor and run
it in R using source().
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764
...
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
85764 Neuherberg, Germany
couple of pages of pretty much
every introducory manual.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter
On Thu, Oct 09, 2003 at 07:39:58AM -0700, christoff pale wrote:
Hi,s there a .Rrc file? so that when R starts up
it automatically loads this file?
?Startup
will tell you everything you want to know - especially bout the
.Rprofile file.
cu
Philipp
--
Dr. Philipp Pagel
- data.frame(as.matrix( subset(myd, TYPE=='A') ))
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1
building I initially had the same problem. By
looking at other peoples *.Rd files I discovered that you need to
separate individual sections of documentation by \eof. Writing R
Extensions doesn't seem to mention this, though.
hope it helps
Philipp
--
Dr. Philipp Pagel
'' and ' for quoting by default. Gene
descriptions love to contain things like 5' and 3'.
= Try quote='' in the read.table call.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax. +49-89-3187-3585
GSF - National
site:
http://www.r-project.org
In addition to the official manuals I found the Simple R manual very
helpful. It's under contributed documentation.
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics / MIPS Fax
))
R gives me a warning 'parameter ylim couldn't be set in high-level
plot() function' but sets the limit as requested, anyway.
Any ideas what I'm doing wrong? Is this a bug?
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
Institute for Bioinformatics
there is no R function to do this in a more
readable way. Actually, the behaviour of as.numeric() doesn't strike me
as very intuitive. I'm sure it has been implemented that way for a
reason - but what is it?
cu
Philipp
--
Dr. Philipp PagelTel. +49-89-3187-3675
69 matches
Mail list logo