RE: [R] multiple peaks in data frame

2003-11-26 Thread Wilkinson, Mark
I don't quite understand your English, but I'll take a stab at answering your 
question.  If by date you mean data and by peaks maxima, then

df - data.frame(V1=c(23, 4, 56, 7, 99, 33))
interval - 2
if (nrow(df) %% interval == 0) 
tapply(df$V1, rep(1:(nrow(df) / interval), each=interval), max)

might be what you need.


Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent those of St. 
Jude Children's Research Hospital.


 -Original Message-
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent:   Wednesday, November 26, 2003 4:09 PM
To: [EMAIL PROTECTED]
Subject:[R] multiple peaks in data frame

Hello, it wanted to know how I can extract of a dates frame the values 
peaks according to an interval that I
establish.  For example if dates are: 
1 23
 2 4
 3 56
 4 7
 5 99
 6 33
 extract the date i wanted to divide into intervals of 2 an
d to take alone the numbers 23, 56 and 99 of those 3 intervals.  Thanks 
Ruben

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] axis annotation

2003-02-27 Thread Wilkinson, Mark
Hi,

Is there a way to specify a vector of colors for the tick annotation in a
call to axis(), to achieve the x-axis here?


 Rplot003.png 

Thanks,

Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.




Rplot003.png
Description: Binary data


RE: [R] more mulitpage postscript problems

2003-02-21 Thread Wilkinson, Mark
Doh!  

The second loop should be
for (j in i:min(i+3, 16)) {

Thanks for the help!

Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.


 -Original Message-
From:   Michael Na Li [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, February 21, 2003 2:53 PM
To: Wilkinson, Mark
Subject:Re: [R] more mulitpage postscript problems

On Fri, 21 Feb 2003, Mark Wilkinson stated:

  
  tmp - matrix(runif(16000), nrow=16)
  ##postscript(paper='letter')
  for (i in seq(1, 16, 4)) {
X11()
par(mfrow=c(2, 2))
for (j in 1:min(i+3, 16)) {
  plot(density(tmp[j, ], from=0, to=1), lwd=3, main=paste(i, j))
}
  }
  ##dev.off()
  
  When I run as is, I get what I want: four 'pages', 4 plots each.  But
when
  I comment X11(), and uncomment the first and last lines, the postscript
  file I get has 10 pages!

You do have 40 plots so you should get 10 pages with 4 plots on each page.
However, X11() is only called 4 times that is why you only have four
plot windows popping up.  Pages plotted on the same plot window will
override
previous pages, for obvious reasons.

Michael

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] legend

2003-02-12 Thread Wilkinson, Mark

I think I'm missing something tonight in the usage of 'legend':

plot(0, type=n)
legend(locator(1), month.abb[1:5], pch=15, col=1:5)

gives me something similar to what I want. But

legend(locator(1), month.abb[1:5], fill=T, col=1:5)

gives me 5 black boxes.

What am I doing wrong?

Thank you, 


 version
 _
platform i686-pc-linux-gnu
arch i686
os   linux-gnu
system   i686, linux-gnu
status
major1
minor6.1
year 2002
month11
day  01
language R


Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] png()/jpeg()

2003-01-31 Thread Wilkinson, Mark
When I execute the following code, it works just like I want it to: three
pages of nine (or fewer) plots.  However, when I execute the code with the
first and last lines uncommented, I get three pages (files), but the 2nd 
3rd pages have overlapping plots.  It's like a new page wasn't created.  

I'm pretty sure I've either misplaced or left out a crucial call to some
function, but I'm not sure where. Please help.


#png(width=937, height=703, pointsize=15)
for (i in seq(1, 24, 9)) {
  par(mfrow=c(3, 3))
  
  for (gt in i:min((i+8), 24)) {

plot(density(rnorm(1000)))

for (j in 1:20) { 
  lines(density(rnorm(1000)), lty=4, col=gray)
}
  }
}
#dev.off()


Thanks,


Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



RE: [R] png()/jpeg()

2003-01-31 Thread Wilkinson, Mark
Sorry:

 _
platform i686-pc-linux-gnu
arch i686
os   linux-gnu
system   i686, linux-gnu
status
major1
minor6.1
year 2002
month11
day  01
language R



Mark Wilkinson
Informatics Analyst
St. Jude Children's Research Hospital
Department of Pharmaceutical Sciences

The opinions expressed here are my own and do not necessarily represent
those of St. Jude Children's Research Hospital.


 -Original Message-
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, January 31, 2003 2:24 PM
To: Wilkinson, Mark
Cc: R-help (E-mail)
Subject:Re: [R] png()/jpeg()

It really would help to know the platform here: Windows and Unix have
separate implementations.  On Windows with R 1.6.2 there is no overlap 
that I can see.

Also the version of R, please.

On Fri, 31 Jan 2003, Wilkinson, Mark wrote:

 When I execute the following code, it works just like I want it to: three
 pages of nine (or fewer) plots.  However, when I execute the code with the
 first and last lines uncommented, I get three pages (files), but the 2nd 
 3rd pages have overlapping plots.  It's like a new page wasn't created.  
 
 I'm pretty sure I've either misplaced or left out a crucial call to some
 function, but I'm not sure where. Please help.
 
 
 #png(width=937, height=703, pointsize=15)
 for (i in seq(1, 24, 9)) {
   par(mfrow=c(3, 3))
   
   for (gt in i:min((i+8), 24)) {
 
 plot(density(rnorm(1000)))
 
 for (j in 1:20) { 
   lines(density(rnorm(1000)), lty=4, col=gray)
 }
   }
 }
 #dev.off()

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help