Re: [R] Hershey fonts for musical notation?

2007-01-03 Thread Christophe Declercq
Hi, Atte 

 De : [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] De la part de Atte Tenkanen
 Envoyé : mercredi 3 janvier 2007 09:17
 Hi,
 
 I'd like to know if it is possible to use Hershey vector 
 fonts to create very primitive musical notation. 
 [...]

There is an example of a music score produced with R and the Hershey fonts
in the book 'R Graphics', by Paul Murrell (Chapman  Hall/CRC, 2005), page
15.

The R Code is on the web page for the book:
http://www.stat.auckland.ac.nz/~paul/RGraphics/examples-stevemiller.R

BTW, I do a lot of things with R but for music scores I use the ABC language
(http://www.walshaw.plus.com/abc/). You can output PostScript from it with
Jef Moine's abcm2ps (http://moinejf.free.fr/).

Happy new year!

Christophe
-- 
Christophe Declercq, MD
Observatoire régional de la santé
Nord-Pas-de-Calais
235, avenue de la recherche
BP 86 F-59373 LOOS CEDEX
Phone +33 3 20 15 49 24
Fax + 33 3 20 15 10 46
E-mail [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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.


Re: [R] quantile() with weights

2006-06-12 Thread Christophe DECLERCQ
  De : [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] De la part de Wouter
 Envoyé : vendredi 9 juin 2006 19:15
 Hi list,
 
 I'm looking for a way to calculate quantiles (such as in 
 quantile()), but with the ability to assign a different 
 weight to each member of the sample vector.
 [...]
 
See 'wtd.quantile' in the 'Hmisc' package. 

Christophe
--
Christophe Declercq, MD
Observatoire régional de la santé Nord-Pas-de-Calais
235, avenue de la recherche
BP 86 F-59373 LOOS CEDEX
Phone +33 3 20 15 49 24
Fax + 33 3 20 15 10 46
E-mail [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] measurement unit

2005-09-09 Thread Christophe Declercq
Adrian,

 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Adrian DUSA
 Envoye : vendredi 9 septembre 2005 09:54
 
 Dear R-list,
 
 Could anybody tell me where to find information about 
 changing the measurement 
 unit from inch to centimeters? 
 I read the help from X11, I read R-intro and I did some 
 searhing in the R 
 archives, but I couldn't find the answer.
 For example, I would like to produce a plot of a certain 
 width and height:
 
 X11(width=10, height=5)
 and I would like these to be centimeters, rather than inches.
 
 Thank you,
 Adrian

1 inch = 2.54 cm

So you could try what I do for that

 X11(width=10/2.54, height=5/2.54)

Or

 cm2in-function(x) x/2.54
 X11(width=cm2in(10), height=cm2in(5))

HTH

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]
 

 
 -- 
 Adrian Dusa
 Romanian Social Data Archive
 1, Schitu Magureanu Bd
 050025 Bucharest
 Romania
 Tel./Fax: +40 21 3126618 \
   +40 21 3120210 / int.101
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Decimal point as a comma in postcript and pdf graphics

2005-03-09 Thread Christophe Declercq


 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de
 Peter Dalgaard
 Envoye : mercredi 9 mars 2005 15:19


 Ronny Klein [EMAIL PROTECTED] writes:

[...]
  I would like to have a comma instead of a point as
 the decimal point in my
  graphics, i.e. postscript and pdf files, for I write my
 thesis in German. My
[...]

 We don't have a way of formatting numbers according to
 LC_NUMERIC, as
 far as I know. This leaves it to you to set up axes etc. to your
 liking, e.g.

  x - rnorm(100,,.2)
  p - pretty(x)
  hist(x,xaxt=n)
  axis(1, at=p, labels=sub(\\., ,, p))

 (and possibly throw in xlim=range(p) on the hist() call. Or use
 axTicks(), which is probably a better idea.)

When I need that, I use something like Peter but with the 'format'
function, for example:

  x - rnorm(100,,.2)
  p - pretty(x)
  hist(x,xaxt=n)
  axis(1, at=p, labels=format(pretty(x), decimal.mark=,))

Hope it helps.

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]



  Ronny
 
 
  PS: The problem of displaying the German umlauts, I have
 already solved: I
  have to use the WinAnsi.enc as the default encoding file.
 Which is odd in my
  opinion.

 This should improve in 2.1.0 (or at least be broken in new and
 interesting ways) due to support for UTF-8 encodings.

 --
O__   Peter Dalgaard Blegdamsvej 3
   c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
  (*) \(*) -- University of Copenhagen   Denmark  Ph:
 (+45) 35327918
 ~~ - ([EMAIL PROTECTED]) FAX:
 (+45) 35327907

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html



__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] how to produce disease maps

2005-02-25 Thread Christophe Declercq

 Oarabile == Oarabile Ruth Molaodi
[EMAIL PROTECTED]
 on Thu, 24 Feb 2005 17:06:40 + writes:

Oarabile how to do disease maps in R?  I want to produce
Oarabile disease maps (A map which shows distribution of a
Oarabile disease in areas of a city , country e.t.c) for
Oarabile the spatial geographical data I have and I'm
Oarabile wondering if this can be done in R. I realise that
Oarabile there is maps package ,mapdata and e.tc. but these
Oarabile do not show how.

Please study the two vignettes in the 'spdep' package.

They should put you on the right track.

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Using sweave

2005-02-18 Thread Christophe Declercq


 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de
 Matthieu Cornec
 Envoye : vendredi 18 fevrier 2005 17:40

 hello,

 Suppose in Rnw file, I compute a numeric of name x
 containing the value 1.
 In my tex file, I want to write

 Let x= the real value of x
 so that I can see in my dvi file : Let x = 1,
 with 1, the actual value of x written in a math
 environnement for example.

Try the \Sexpr{} command in LaTeX (see the Sweave manual). It's OK for
a scalar.

For example, something like this in the body of your LaTeX file should
do what you want:

=
x-1
@

Let $x=\Sexpr{x}$


Christophe

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] S latex listings

2004-09-28 Thread Christophe Declercq


 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Josep Perarnau
 Envoye : mardi 28 septembre 2004 10:38
 A : [EMAIL PROTECTED]
 Objet : [R] S latex listings


 Hello,

 I would like to insert S code to my latex document. I was looking for a
 listings package that supports S. In www.r-project.or in the
 software/other section there is an item with a link to latex package
 listings, but it seems that the link is broken. Does anybody know an
 alternative to get the package?
[...]

Try the TeX catalogue online:
http://www.tug.org/tex-archive/help/Catalogue/brief.html

You will find that you can get the 'listings' package at:
http://www.tug.org/tex-archive/macros/latex/contrib/listings/


Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Hawaii in map() function

2004-09-05 Thread Christophe Declercq

 From: Michelle Bell [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 05, 2004 9:08 PM
 Subject: [R] Hawaii in map() function


 I would like to use the map function for the continental US plus Hawaii, 
 but can only find the library files for the continental US. Suggestions?

You can find Hawaii in the world map database

You could try:

 library(map)
 map(world, c(USA, Hawaii))
 
which has perhaps more than what you want, or try something like:

 map(usa, xlim=c(-170,-60), ylim=c(15,55))
 map(world, Hawaii, add=TRUE)

Christophe

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] image() with color key?

2004-09-03 Thread Christophe Declercq
Hi, Michael

Did you try 'image.plot' in the 'fields' package?

Christophe

- Original Message -
From: Michael Jerosch-Herold [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 03, 2004 9:42 PM
Subject: [R] image() with color key?


 Is there an easy way to plot a color key next to a color image (with
 image() in graphics package)? The color key should also include a
 numerical scale, so that the colors can be cross-referenced with image
 intensity values. I see that levelplot has a facility for color keys,
 but with image it seems less straightforward, i.e. generating a color
 key is not an option in image().

 Thank you!

 Michael Jerosch-Herold

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html



__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Problem with par(usr)

2004-06-03 Thread Christophe Declercq
Bonjour, Nicolas

par('usr') is read-only (see '?par')

That makes sense: user coordinates come from what you have plotted.

Would you show us an example of what exactly you want to do?

Christophe
--
Christophe Declercq, MD
Observatoire régional de la santé Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cédex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]



 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Nicolas STRANSKY
 Envoyé : jeudi 3 juin 2004 11:36
 À : [EMAIL PROTECTED]
 Objet : [R] Problem with par(usr)


 Hi,

 I'm trying to use the usr argument but I see no effect of this option
 on my plots. For example:

   par(usr=c(0,4,0,4))
   plot(1,1)

 This plots one point fine, but the coordinates of the plotting region
 are not those that I specified using par()...
 I can check this with
   par(usr)
 [1] 0.568 1.432 0.568 1.432

 What can I change in order to have this usr argument working ?

 The aim of all this is to be able to superpose two plots where xlim and
 ylim arguments are not sufficient for having the same scalings...

 Thanks for your help.
 --
 Nicolas STRANSKY
 Équipe Oncologie Moléculaire
 Institut Curie - UMR 144 - CNRS Tel : +33 1 42 34 63 40
 26, rue d'Ulm - 75248 Paris Cedex 5 - FRANCEFax : +33 1 42 34 63 49

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html



__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Isotopic notation in plots

2004-05-18 Thread Christophe Declercq
Try:

 plot(1:10,xlab=expression(phantom(0)^{14}*C))

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]
 


 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Andersson, Henrik
 Envoye : mardi 18 mai 2004 11:00
 A : [EMAIL PROTECTED]
 Objet : [R] Isotopic notation in plots
 
 
 I really like to use R for all my graphs, and as I work with stable
 isotopes I want to have a proper chemical notation in my plots
 
 I have looked at ?plotmath, but didn't find the answer and also searched
 the R website.
 
 --
 
 plot(1:10,xlab=expression(^{14}*C))  # I want to have a superscript with
 nothing in front, but it doesn't work 
 
 plot(1:10,xlab=expresssion(.^{14}*C))  # this works, but is not
 beautiful
 
 Any ideas ?
 
 
 -
 Henrik Andersson
 Netherlands Institute of Ecology -
 Centre for Estuarine and Marine Ecology
 P.O. Box 140
 4400 AC Yerseke
 Phone: +31 113 577473
 [EMAIL PROTECTED]
 http://www.nioo.knaw.nl/ppages/handersson
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] years from as.POSIXlt

2004-03-10 Thread Christophe Declercq
As I understand it, there is perhaps something bad with 1970-01-01 00:00,
not in R, but in (at least some versions of) MS-Windows (e.g.
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/26357.html).


 version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status
major1
minor8.1
year 2003
month11
day  21
language R

 Sys.info()[c(1:3,5)]
  sysname   release
Windows  NT 5.1
  version   machine
(build 2600) Service Pack 1 x86

 Sys.getlocale(LC_TIME)
[1] French_France.1252

 as.POSIXct(1970-01-01 01:00:00)
[1] 1970-01-01 01:00:00 Paris, Madrid
 as.POSIXct(1970-01-01 00:00:00)
Error in fromchar(x) : character string is not in a standard unambiguous
format
 julian(.leap.seconds)
Error in fromchar(x) : character string is not in a standard unambiguous
format

but, of course, 'julian' is OK with another origin

 julian(.leap.seconds, origin=ISOdate(1900,1,1))
Time differences of 26478.5, 26662.5, 27027.5, 27392 [truncated]

Christophe
--
Christophe Declercq, MD
Observatoire regional de la sante Nord-Pas-de-Calais
13, rue Faidherbe
F-59046 LILLE Cedex
Phone 33 3 20 15 49 24
Fax 33 3 20 55 92 30
E-mail [EMAIL PROTECTED]




 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Prof Brian Ripley
 Envoye : mercredi 10 mars 2004 08:22
 A : Thomas Petzoldt
 Cc : [EMAIL PROTECTED]
 Objet : Re: [R] years from as.POSIXlt


 On Wed, 10 Mar 2004, Thomas Petzoldt wrote:

 (without copying me)

  Prof Brian Ripley wrote:
 
   See ?julian, which says
  
   Note:
  
Other components such as the day of the month or the
 year are very
easy to computes: just use 'as.POSIXlt' and extract the relevant
component.
  
 
  Hello,
 
  unfortunately not all mentioned functions work on all machines. Where

 No function is mentioned in that note!

months(.leap.seconds)
 
  works on all systems, a call to
 
julian(leap.seconds)

 What is `leap.seconds'?

  julian(.leap.seconds)

 works on Windows XP, of course.

  workes perfectly only on Linux (R 1.8.0) but failed on two different XP
  Machines (German XP version):
 
  Error in fromchar(x) : character string is not in a standard
 unambiguous
  format

 What is `leap.seconds' on your machine?  It is an object that as.POSIXct
 is failing on, I suspect (try traceback() to be sure).

  I've tested several things, several versions of msvcrt.dll, different
  PATH settings, locale set to German or USA, R 1.8.1 and R
 1.7.1, but the
problem remains.
 
  On the other hand
 
   as.numeric(format(x, f=%d))
 
  works perfectly, so I do not understand what is wrong with julian()

 Do *read* the advice on how to get yday quoted above.

 --
 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
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html



__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adjacency matrix

2003-10-23 Thread Christophe Declercq
 
 - Original Message - 
 From: Orlando Zacarias [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, October 23, 2003 6:56 PM
 Subject: RE: [R] adjacency matrix
 
 
 
 Hi once again,
 Now i have been trying to run the R changed example from Maptools
 package manual, and errors occur underlined bellow. It is really
 troublesome
 Please assist,
 Orlando.
 ---
 shp - try(library(shapefiles))  
 Error in library(maptools) : There is no package called 'shapefiles'

The message is clear!

  if (class(shp) != try-error) {
 + ShapeDir - system.file(shapes, package=maptools)[1]
 + try1 - read.shapefile(paste(ShapeDir, shapes, sep=/))
 + shppolys - shape2poly(try1, as.character(try1$dbf$dbf$NEIGNO))
 + plotpolys(shppolys)
 + title(main=Polygons for Vermani from shapefiles package)
 + }
  
  try2 - read.shape(system.file(shapes/Vermani.shp,
 + package=maptools/man)[1])
 Error: couldn't find function read.shape
  mappolys - Map2poly(try2, as.character(try2$att.data$NEIGNO))
 Error: couldn't find function Map2poly
  plotpolys(mappolys)
 Error: couldn't find function plotpolys
  title(main=Polygons for Vermani from maptools package)
 Error in title(main = Polygons for Vermani from maptools package) : 
 plot.new has not been called yet
  if (class(shp) != try-error) {
 + plotpolys(shppolys)
 + plotpolys(mappolys, add=TRUE, border=red, lty=dotted)
 + title(main=Polygons for Vermani overplotted from both packages)
 + }
 --

Did you forget:
 library(maptools)
before that?

Christophe

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


RE: [R] adjacency matrix

2003-10-22 Thread Christophe Declercq
Your question is not really clear because:

- I don't know what 'convert.r' do
- I don't know where 'transf.cgm' is (BTW, 'cgm' is not the usual extension
for shapefiles which is 'shp'). Check if it is really in your current
directory.

but, yes, if what you want is to import shapefiles in R, it's easy. Look at
the 'maptools' package on CRAN (there is also a 'shapefiles' package).

And if you want to build an adjacency matrix for a map of polygons (as I
guess from the header of you mail), look at the 'spdep' package, too. It is
then possible to write a text file with your data as a list readable by
WinBUGS.

(I send a copy of my answer to the the R-SIG-GEO mailing list which can be
of interest to you).

Hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]



 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Orlando Zacarias
 Envoyé : mercredi 22 octobre 2003 11:58
 À : [EMAIL PROTECTED]
 Objet : [R] adjacency matrix


 Dear R experts,
 I am new to the list and R software. I need to convert arcview
 file to Winbugs having R has middle package. Got from friends
 that it is possible following the steps:
 1. Converting arcview shapefile to cgm clear text file
 2. Downloading convert.r to into R
 2.1 use source(convert.r)
  2.2 convert(filename_cgm) without the extension.
 But that doesn't work, given the following errors:
 
 R : Copyright 2003, The R Development Core Team
 Version 1.8.0  (2003-10-08)
 R is free software and comes with ABSOLUTELY NO WARRANTY.
 You are welcome to redistribute it under certain conditions.
 Type 'license()' or 'licence()' for distribution details.
 R is a collaborative project with many contributors.
 Type 'contributors()' for more information.
 Type 'demo()' for some demos, 'help()' for on-line help, or
 'help.start()' for a HTML browser interface to help.
 Type 'q()' to quit R.
 [Previously saved workspace restored]
  source(convert.r)
  convert(transf)
 Error in file(file, r) : unable to open connection
 In addition: Warning message:
 cannot open file `transf.cgm'
 
 ---
 Have i done some mistakes?Or i am missing some files?
 Please assist.
 Rgs,
 Orlando.



   [[alternative HTML version deleted]]

 __
 [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


RE: [R] report generator a la epiinfo

2003-10-21 Thread Christophe Declercq
Hi, Lucas

You should try Sweave in the 'tools' package (see
http://www.ci.tuwien.ac.at/~leisch/Sweave/).

You will have to get a TeX/LaTeX distribution and learn a little of LaTeX
but it is worth the effort.

I frequently use R with Sweave on EpiData files (http://www.epidata.dk/)
with great success.

Hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]


 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Lucas Gonzalez
 Santa Cruz
 Envoyé : mardi 21 octobre 2003 11:55
 À : [EMAIL PROTECTED]
 Objet : [R] report generator a la epiinfo


 Hi

 I'd like to use R in epidemiology and disease surveillance.

 In EpiInfo you can have a script (.pgm) which calls a predefined report
 (.rpt), where a table is calculated and values picked from that table
 and placed where the author of the report wants them, with text around
 those values. (Please see example below.)

 I've looked at manuals, faq, mail-search and google. The closest is an
 R Report Generator email that looked as if it wasn't followed after a
 couple of years.

 ##The script might have something like this:
 read.epiinfo(oswego.rec)
 report(oswego.rpt, output=oswego.txt)

 ##The predefined report might have this:
 #{ill}
 Exactly {YES} people fell ill, and {NO} people didn't.
 We don't know about the remaining [({}-{YES}-{NO})*100/{}] percent.
 #{icecream ill}
 We are specifically interested in the number of people who chose vanilla
 and didn't fall ill (all {VANILLA, YES} of them).

 Is there anyway to do this with R? Any direction I should look into?

 Thanks in advance.

 Lucas

 __
 [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


Re: [R] ungrouping grouped data

2003-09-25 Thread Christophe Declercq
Something like that?

 galton2-galton[rep(1:nrow(galton), galton$frequency), 1:2]

Christophe

- Original Message - 
From: Michael Friendly [EMAIL PROTECTED]
To: r-help [EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 7:14 PM
Subject: [R] ungrouping grouped data


 I'm sure this is probably simple, but I can't find an answer...
 I have a data frame (Galton's data on heights of parents and children), 
 in grouped form,
 
 parent child frequency
 73.5 72.2 1
 73.5 73.2 3
 72.5 68.2 1
 72.5 69.2 2
 72.5 70.2 1
 72.5 71.2 2
 72.5 72.2 7
 72.5 73.2 2
 72.5 74.2 4
 71.5 65.2 1
 71.5 66.2 3
 71.5 67.2 4
 71.5 68.2 3
 71.5 69.2 5
 71.5 70.2 10
 ...
 
 and need the ungrouped equivalent, where each input observation
 appears the number of times represented by its frequency.  In SAS
 this would be
 
 data galton2;
 set galton;
 do i=1 to frequency;
output;
 end;
 
 I can replicate this in R, but surely there must be an easier way.
 (In APL2 it would be frequency\[1]galton)
 
 thanks,
 -Michael
 
 -- 
 Michael Friendly Email: [EMAIL PROTECTED] 
 Professor, Psychology Dept.
 York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
 4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
 Toronto, ONT  M3J 1P3 CANADA
 
 __
 [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


RE: [R] Sweave: pass scale parameter to includegraphics?

2003-07-29 Thread Christophe Declercq
Peter,

To set the width of included graphics in your LaTeX document, see the Sweave
manual: http://www.ci.tuwien.ac.at/~leisch/Sweave/Sweave-manual-20030624.pdf

'It also sets the default LATEX figure width (which is
independent of the size of the generated EPS and PDF files).
The current default is \setkeys{Gin}{width=0.8\textwidth} if
you want to use another width for the figures that are
automatically generated and included by Sweave, simply add a
line similar to the one above after \begin{document}.'

Hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]


 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Peter Dunn
 Envoyé : mardi 29 juillet 2003 07:24
 À : R mailing list
 Objet : [R] Sweave: pass scale parameter to includegraphics?


 Hi all

 I'm using Sweave and find it a treat.  But one
 question:

 I use Sweave to create my pictures which are
 automatically included into LaTeX.  For example,
 in the file  test.Snw,  I may have:

 % LaTeX stuff
 \begin{figure}
 fig=true,width=5,height=5=
 x1 - seq(1,5, length=10)
 x2 - sin(x1)
 plot(x1,x2)
 @
 \caption{Plot}
 \end{figure}
 % More LaTeX

 This produces the LaTeX file test.tex with the
 (example) chuck:

 % LaTeX stuff
 \begin{figure}
 \includegraphics{test-001}
 \caption{Plot}
 \end{figure}
 % More LaTeX stuff

 But what if I want the chunk to be, for example,
\includegraphics[scale=0.6]{test-001}
 rather than the standard, no frills \includegraphics
 command?  (Why?  Because I create a picture that I
 want small!  Changing  width  and  height within the
 = only changes the appearance of the picture--it
 alters the x11 window the plot is produced in, not
 the final size in my document.)

 How can I inform Sweave to create this in the
 LaTeX code (not universally, but in the occasional
 picture)?  More generally, how can I inform Sweave
 to pass these types of parameters to the
 \includegraphics command?

 I have searched archives and all the (obvious to me)
 places, but haven't found the solution.

 Thanks again,

 P.

 --
 Dr Peter Dunn  (USQ CRICOS No. 00244B)
   Web:http://www.sci.usq.edu.au/staff/dunn
   Email:  dunn @ usq.edu.au
 Opinions expressed are mine, not those of USQ.  Obviously...

 __
 [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


RE: [R] curves with shaded areas?

2003-07-22 Thread Christophe Declercq
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Johannes
 Fuernkranz
[...]
 I want to make a plot with abline where the area below or above the
 curve is shaded. I can't find any documentation on that. Can anybody
 help me with that?
[...]

You have to play with par(usr).

See the toy example below, perhaps a little naive, but it seems to do what
you want.

##
tmp-rnorm(100)
mydf-data.frame(x=tmp, y=0.5*tmp+rnorm(100))
plot(y~x, mydf)
myreg-lm(y~x, mydf)
abline(myreg)
x1-par(usr)[1:2]
y1-par(usr)[3]
myxy-rbind(
  cbind(x1, predict(myreg, data.frame(x=x1))),
  cbind(rev(x1), rep(y1,2))
)
polygon(myxy, col=grey)
##

I hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

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


RE: [R] french map

2003-06-30 Thread Christophe Declercq
Nathalie,

You could have a look at the web site of the Institut Géographique National
(http://www.ign.fr) where you can download a free SHAPEFILE with polygon
data for the French départements. You can choose one of two projections:
LAMBERT II étendu or LAMBERT 93
(http://www.ign.fr/affiche_rubrique.asp?rbr_id=810lng_id=FR). In the
associated DBF file, you get the name and the x,y coordinates for the
préfecture of each département.

You could use these data in R with one of the packages which read shapefiles
(for example, 'shapefiles' which is on CRAN or the draft package 'maptools'-
see http://spatial.nhh.no/R/ - which is already very useful as it is).

I hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Peyrard Nathalie
 Envoyé : lundi 30 juin 2003 15:21
 À : [EMAIL PROTECTED]
 Objet : [R] french map


 Hello,

 I would like to know if (as the usa map with Splus), it is possible with
 R to plot the french map and to add points (representing towns for
 instance) on the figure in the appropriate (x,y) system.
 Thank you.

   Nathalie Peyrard

 __
 [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


RE: [R] VIM Syntax Highlighting

2003-03-11 Thread Christophe Declercq


 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Luke Whitaker
 Envoyé : mardi 11 mars 2003 12:08
 À : [EMAIL PROTECTED]
 Cc : [EMAIL PROTECTED]
 Objet : Re: [R] VIM Syntax Highlighting

[...]
 Version 5.6.70 of vim comes with a syntax file for S-lang as standard.
 Either pick S-lang from the Syntax menu or do :cal SetSyn(slang)
 on the vim command line. Not surprisingly, this works perfectly well
 with either S or R.


S-lang (see http://www.s-lang.org/) is not R/S...

As already said, you should use the 'r.vim' syntax file in recent versions
of vim.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

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


RE: [R] VIM Syntax Highlighting

2003-03-10 Thread Christophe Declercq
Hi, Fernando

 -Message d'origine-
 De : [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] la part de Fernando Henrique
 Ferraz Pereira da Rosa
 Envoyé : lundi 10 mars 2003 01:52
 À : [EMAIL PROTECTED]
 Objet : [R] VIM Syntax Highlighting


  Has anyone got vim to have syntax highlighting with R
 function codes? I
 know there's something similar that works with emacs (ESS or
 something like
 that), but I was wondering if anyone knew an equivalent that
 worked with vim.

I use the MS-WINDOWS port of vim version 6, which has a syntax file for R by
Tom Payne (see http://linux.clare.cam.ac.uk/~twp20/vim/syntax/r.vim).

You can also use both TeX and R syntax in Sweave files. Below is what I use
in my 'noweb.vim' file:


syntax clear
runtime! syntax/tex.vim
syntax include @nowebR syntax/r.vim
syntax region nowebChunk start=^.*= end=^@  [EMAIL PROTECTED]
syntax region Sexpr  start=\\Sexpr{  end=} keepend
hi Sexpr gui=bold guifg=chocolate2

Hope it helps.

Christophe
--
Christophe DECLERCQ, MD
Observatoire Régional de la Santé Nord-Pas-de-Calais
13, rue Faidherbe 59046 LILLE Cedex FRANCE
Phone +33 3 20 15 49 24
Fax   +33 3 20 55 92 30
E-mail [EMAIL PROTECTED]

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