RE: [R] dot density maps
Dear Roger, Thank you very much for the reply. And now I have to a apologize for my late response. I was quite a while out of the office. This is exactly what I was looking for. I think it will be of great help to have this implemented in a package. Johannes -Original Message- From: Roger Bivand [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 8:42 PM To: Johannes SCHNITZLER Cc: [EMAIL PROTECTED] Subject: Re: [R] dot density maps On Wed, 22 Sep 2004, Johannes SCHNITZLER wrote: ... I'm looking for the possibility to draw points (randomly positioned or positioned according to a grid) into the polygons instead of filling the polygons with colors. I apologize for not replying earlier. I think that you can combine the polylist class from the maptools package with the csr function in the splancs package to position points randomly (the gridpts() finction can be used instead of csr() to give grid points): . . Could you indicate whether this function is any use, and if you would like it added to some suitable package? Roger Bivand __ [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 -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 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
[R] dot density maps
Dear All, In the moment i'm using the map and maptools package to read shapefiles and display the maps. I'm looking for the possibility to draw points (randomly positioned or positioned according to a grid) into the polygons instead of filling the polygons with colors. For example: a map (shapefile) with 10 countries, 15 points in the polygon of country A, 20 points in the polygon of country B. Thank you in advance for your help Johannes [[alternative HTML version deleted]] __ [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
[R] Greek fonts
Dear all, I need Greek text in titles, axis labels, etc. for graphs. The Graphs are produced in png-format - to use them later on in HTML pages. As the output has to be multilingual they are produced in a loop (for each language). The strings for the titles, labels ... are stored in a text file (Greek, English, French...). The only way I found so far - for Greek - is: 1) change the Rdevga by adding Courier to the fonts (the only font that worked for me). 2) Change the language for non-unicode programs in the windows setting to Greek Is there a way to avoid changing the setting for non-unicode programs in windows. If I'm changing the setting to Greek, non uni-code characters of other languages are not displayed correctly (ex. accents in French) Is there a way without changing the Rdevga in order to avoid manipulation after installation of R. Something like par(font=Courier : plain) I'm using R Version: 1.9 Windows: XP Thank you in advance for any help Johannes [[alternative HTML version deleted]] __ [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
[R] Rterm
Dear all, Two questions regarding rterm First: C:\Program Files\R\rw1081\bin\rterm.exe --vanilla test.r --args Arg1 Arg2 worked for me so far with r Version 1081, to start a R script with the given arguments. With R1090 C:\Program Files\R\rw1090\bin\rterm.exe --vanilla test.r --args Arg1 Arg2 There is the error message: Rterm.exe is not a valid Win32 application I tried on Windows 2000 and XP I couldn't find out what to change. Second: I would like to set the working directory as well, in the same command, when calling an r script with rterm.exe from the command line. Is there a way to do this? Can somebody help me with these issues? Thank you Johannes [[alternative HTML version deleted]] __ [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] Rterm
Dear Jason, Thank you very much, the first problem is solved. It was a corrupted file. After downloading a new version rterm works! The second question: I was trying to set the working directory while I'm calling a script with Rterm.exe from the command line. Something like c:\Program Files\R\rw1090\bin\rterm.exe --vanilla workingdir=c:/data/ test.r --args Arg1 Arg2 Thank's again Johannes -Original Message- From: Jason Turner [mailto:[EMAIL PROTECTED] Sent: 07 May 2004 12:15 To: Johannes SCHNITZLER Cc: [EMAIL PROTECTED] Subject: Re: [R] Rterm With R1090 C:\Program Files\R\rw1090\bin\rterm.exe --vanilla test.r --args Arg1 Arg2 There is the error message: Rterm.exe is not a valid Win32 application I tried on Windows 2000 and XP I couldn't find out what to change. Weird. Did you install in C:\Program Files\R\rw1090\? On my XP machine, it did, and rterm is valid. The above works from a command prompt, provided I wrap the executable path and name in quotes. Failing that, is it a corrupt binary install? Here's the md5 of my (working) R-1.9.0, downloaded from CRAN (NOT the patched version, and not built by me) C:\Program Files\R\rw1090\bin md5sum.exe Rterm.exe 2565cd848bbd86b964624a0490352da2 *Rterm.exe I would like to set the working directory as well, in the same command, when calling an r script with rterm.exe from the command line. Is there a way to do this? Inside R: setwd(your/path/here) With the usual warning about using / slashes, or \\ slashes (doubled). I just stick with /. Cheers Jason __ [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] Rterm
Thank you very much for the fast answers, It work's very well Johannes -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 07 May 2004 16:16 To: Jason Turner Cc: Johannes SCHNITZLER; [EMAIL PROTECTED] Subject: Re: [R] Rterm On Sat, 8 May 2004, Jason Turner wrote: Johannes SCHNITZLER wrote: The second question: I was trying to set the working directory while I'm calling a script with Rterm.exe from the command line. Something like c:\Program Files\R\rw1090\bin\rterm.exe --vanilla workingdir=c:/data/ test.r --args Arg1 Arg2 Not sure - if you could pass the working directory as an arg, then R can handle it from there - use the setwd() command. What I usually do on Un*x-like systems is to cd to the directory first, then start the R run. Something like cd my favorite dir R --vanilla ... Since you're already specifying the absolute path for Rterm, the above should work... That's the only way. The `working directory' is the directory from which you launch an application (although you can fix that by a shortcut). R looks in the working directory for several things, e.g. a .Rprofile file, before it ever runs any R code like setwd. If that is not a problem you can use something like (from a decent shell) (echo setwd(somewhere); cat test.r) | Rterm.exe --args Arg1 to make the first R code run change directories. Or you can have at the top of test.r setwd(Sys.getenv(WD)) and use Rterm.exe WD=c:/data test.r --args Arg1 Arg2 -- 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
[R] dbf write
Dear all, i'm looking for a possibility to save a data frame in dbase format without using RODBC. Has anybody a r-script / package for this purpose? Thank's in advance for your help. Johannes __ [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
[R] PNG Problem on Windows 98
Thank you for the reply, i tried it with the devel version 1090 (18.02.2004) but it is still the same problem. Is there any other solution. As said before it works on 1 Windows 98 Computer but not on the other's. I can't change the operating system of the computers. Which files of windows could i check? Thank's again. Johannes __ [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
[R] PNG Problem on Windows 98
Dear all, with the new version of R it is normally no problem to produce very fast graphics in the png format. In the office i want to work with R - Windows 98 is used. There are french versions and english versions of Windows 98 second edition. The png graphics are only on one computer correct. On the other computers - the x-axis labels, the legend text and the mtext (on the bottom) is missing. Attached are simple example files one in jpg (which is ok) and one in png format. produced with: png(test3.png); plot(1:100); mtext(c(aaa,bbb),c(1,2),c(4,1)); legend(50,50,); dev.off() for jpeg with jpeg(..) Any idea where the difference in the installation could be, like missing files ore necesarry updates for the windows system? Thank you very much in advance for any help. Johannes__ [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
[R] PNG Problem on Windows 98
For clarification to my first email (PNG Problem on Windows 98 ), i'm using R 1.8.1 .with the new version of R it is normally no problem to produce very fast graphics in the png format. In the office i want to work with R - Windows 98 is used. There are french versions and english versions of Windows 98 second edition. The png graphics are only on one computer correct. On the other computers - the x-axis labels, the legend text and the mtext (on the bottom) is missing. Johannes __ [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] Questions about png() on Windows
Thank you for the reply, it is not essential that the format is png. Every format that can be displayed in a web browser would be fine. for an interactive web application i need to produce a lot of graphics (up to 50) on demand. In the moment i'm using the png format. The png() ...using png(file=Rplot%03d.png, ...); 'plots' ; dev.off()... produces very good graphics. The problem is it takes too long to produce the png files. The bitmap() ...using bitmap(file=Rplot%03d.png, type=type = png256,...); 'plots'; dev.off()... works really fast. But on my system the quality is poor compared with png() even with a higher resolution than 72. I'm using R 1.7.0 on Windows NT ; Ghostscript 8.00 1) Is there a possibility to speed up the png() or to improve the quality of the png produced by bitmap() There is a possibility. You have the source code, and we would be happy for you to optimize it and submit a faster version. It looks up pixel values one at a time, and the use of block operations should speed it up. I don't think i have the ability (in the moment) to do so - but i will have a try Meanwhile: has somebody experience in improving the quality by setting different parameters? 2) How is it possible to give names to the png files (if producing more than one plot) instead of Name+serial number like Rplot%03d.png Just start a new device for each plot! To open a new device every time slows it down again. On my sytem: system.time({ for(i in 1:50){xy-paste(i,.png,sep=);bitmap(xy);plot(rnorm(100));dev.off()} }) [1] 4.40 5.62 42.70NANA system.time({ bitmap(%03d.png);for(i in 1:50){plot(rnorm(100))};dev.off() }) [1] 0.62 0.16 1.49 NA NA Thank you in advance Johannes __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] (no subject)
Dear all, for an interactive web application i need to produce a lot of graphics (up to 50) on demand. In the moment i'm using the png format. The png() ...using png(file=Rplot%03d.png, ...); 'plots' ; dev.off()... produces very good graphics. The problem is it takes too long to produce the png files. The bitmap() ...using bitmap(file=Rplot%03d.png, type=type = png256,...); 'plots'; dev.off()... works really fast. But on my system the quality is poor compared with png() even with a higher resolution than 72. I'm using R 1.7.0 on Windows NT ; Ghostscript 8.00 1) Is there a possibility to speed up the png() or to improve the quality of the png produced by bitmap() 2) How is it possible to give names to the png files (if producing more than one plot) instead of Name+serial number like Rplot%03d.png Any help would be appreciated Johannes [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] time series outbreak detection
Dear all, i have multivariate timeseries (weekly data). 1)Moving standard deviation With the filter function together with lag from package ts it is possible to calculate a moving average for the time series for each week at once (6 weeks back from the actual week and 12 weeks from the last two years). But i also need the associated standard deviations. Is there a function for this? 2)Robust Regression The time series derives from reported cases due to different pathogens. Some of them with saisonal pattern. There are huge differences in counts (depending on the pathogen) from zero up to several hundred counts per week. I have only data since 2001. I want to realize outbreak detection algorithms (so far, depending on the pathogen with Standard Deviation / Poisson and CUSUM). Beforehand i have to clean the data from past outbreaks. Has anybody experience with a rather robust regression model which cuts former outliers? Thank you very much for advice. Johannes Schnitzler Germany Berlin [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] rownames as parameter in functions
Dear all, i want to give the names of columns of a data set (dat) as parameter to a function, in order to select single rows by the row names. I tried several ways. Like: the data set : dat A B C D E 1 2 3 1 6 1 4 5 2 4 .. .. .. .. .. the.col.names-c(A,C) f-function(par){sapply,function(par)(dat$par*2)} f(the.col.names) Should give the result A C 2 6 2 10 .. .. Thank you in advance Johannes Schnitzler [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help