[R] X11 fonts and Ubuntu
Hi, I am moving from Windows XP to Ubuntu 6.10 and installed R 2.4.0. When I run eg plot.lm (things work fine with plot.default - eg plot(rnorm(30),rnorm(30))) plot(lmobject) I can get the first plot and then this message: Hit Return to see next plot: Error in text.default(x, y, labels.id[ind],cex=cex, xpd=TRUE, : could not find any X11 fonts Check that the Font Path is correct I have googled through the R-help list and it seems that such troubles already occured sometimes (see link below and threads) http://lists.freebsd.org/pipermail/freebsd-ports/2005-June/024091.html http://tolstoy.newcastle.edu.au/R/help/06/03/23864.html but did not find solution. Some messages claim it is a X11 problem (not R) some others suggest it may come from R. Some also mention that UTF-8 may be a problem (though I don't have specific message on this from R). I have re-installed x11-common via the Synaptic package manager (so I suppose X11 is well installed) without improvement. I have checked /etc/X11/ xorg.conf Section Files FontPath /usr/share/X11/fonts/misc FontPath /usr/share/X11/fonts/100dpi/:unscaled FontPath /usr/share/X11/fonts/75dpi/:unscaled FontPath /usr/share/X11/fonts/Type1 FontPath /usr/share/X11/fonts/100dpi FontPath /usr/share/X11/fonts/75dpi FontPath /usr/share/fonts/X11/misc FontPath /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType Endsection but cannot identify where the problem is actually thus no remedy. Any idea? __ 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] ks.test greater and less
Prof Brian Ripley schrieb: On Sat, 16 Dec 2006, R. Villegas wrote: 2006/12/15, Carmen Meier [EMAIL PROTECTED]: Hello r-group I have a question to the ks.test. I would expect different values for less and greater between data1 and data2. Does anybody could explain my point of misunderstanding the function? The help page says: This is a comparison of cumulative distribution functions, and the test statistic is the maximum difference in value, with the statistic in the 'greater' alternative being D^+ = max_u [ F_x(u) - F_y(u) ]. data1 and data2 have the same empirical CDF, so should and do give the same value of the test statistic. We cannot know what you misunderstanding is, since you have not explained your expectations. Thank you for your answers, seems that I was abusing the R-Group for statistical question which should be posted in f.e. sci.stat.edu. .. the misunderstanding was, that I thought ks.test is different between sort order decreasing and increasing. With regards Carmen __ 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] X11 fonts and Ubuntu
Hi, I have observed this as well (Debian etch, R 2.4.0), with small cex values when drawing text. My LANG environment variable was set to en_NZ.UTF-8; setting this to C or en_NZ seems to prevent the error occuring. I presume my installation is missing a few fonts, yours may be too. HTH, Rich Setting the environment variable LANG=C before running R seems to work as a workaround (normally this is en_NZ.UTF-8 On 12/17/06, Patrick Giraudoux [EMAIL PROTECTED] wrote: Hi, I am moving from Windows XP to Ubuntu 6.10 and installed R 2.4.0. When I run eg plot.lm (things work fine with plot.default - eg plot(rnorm(30),rnorm(30))) plot(lmobject) I can get the first plot and then this message: Hit Return to see next plot: Error in text.default(x, y, labels.id[ind],cex=cex, xpd=TRUE, : could not find any X11 fonts Check that the Font Path is correct I have googled through the R-help list and it seems that such troubles already occured sometimes (see link below and threads) http://lists.freebsd.org/pipermail/freebsd-ports/2005-June/024091.html http://tolstoy.newcastle.edu.au/R/help/06/03/23864.html but did not find solution. Some messages claim it is a X11 problem (not R) some others suggest it may come from R. Some also mention that UTF-8 may be a problem (though I don't have specific message on this from R). I have re-installed x11-common via the Synaptic package manager (so I suppose X11 is well installed) without improvement. I have checked /etc/X11/ xorg.conf Section Files FontPath /usr/share/X11/fonts/misc FontPath /usr/share/X11/fonts/100dpi/:unscaled FontPath /usr/share/X11/fonts/75dpi/:unscaled FontPath /usr/share/X11/fonts/Type1 FontPath /usr/share/X11/fonts/100dpi FontPath /usr/share/X11/fonts/75dpi FontPath /usr/share/fonts/X11/misc FontPath /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType Endsection but cannot identify where the problem is actually thus no remedy. Any idea? __ 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. -- Rich FitzJohn rich.fitzjohn at gmail.com __ 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.
[R] Draw a circle on a filled.contour() plot
Hi all, I'm trying to use symbols() to draw a circle of a given radius at a given position onto a filled.contour() plot. The commands I issue are: filled.contour(y,x,z,levels=seq (0.02,1.0,len=50),color.palette=colorRampPalette(c (blue,yellow,red)),title=title(main=,xlab=,ylab=)) symbols(0.62,0.0,circles=c(2.5),add=TRUE,inches=FALSE As can be seen on the resulting PDF file (http://www.eleves.ens.fr/ home/coudert/hist_2d.pdf), the circle appears to have the right radius but its center is not the correct one [0.62, 0]. What am I missing here? Thanks for your help, FX PS: complete input (5 lines), data file for the contour plot and PDF result on my system can be found at: Data file: http://www.eleves.ens.fr/home/coudert/hist_2d R script: http://www.eleves.ens.fr/home/coudert/hist_2d.R PDF result: http://www.eleves.ens.fr/home/coudert/hist_2d.pdf __ 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] Draw a circle on a filled.contour() plot
On 12/17/2006 7:06 AM, Webmaster wrote: Hi all, I'm trying to use symbols() to draw a circle of a given radius at a given position onto a filled.contour() plot. The commands I issue are: filled.contour(y,x,z,levels=seq (0.02,1.0,len=50),color.palette=colorRampPalette(c (blue,yellow,red)),title=title(main=,xlab=,ylab=)) symbols(0.62,0.0,circles=c(2.5),add=TRUE,inches=FALSE As can be seen on the resulting PDF file (http://www.eleves.ens.fr/ home/coudert/hist_2d.pdf), the circle appears to have the right radius but its center is not the correct one [0.62, 0]. What am I missing here? There's a note on the man page about this: The output produced by 'filled.contour' is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the 'plot.axes' argument. An example is given below. Duncan Murdoch Thanks for your help, FX PS: complete input (5 lines), data file for the contour plot and PDF result on my system can be found at: Data file: http://www.eleves.ens.fr/home/coudert/hist_2d R script: http://www.eleves.ens.fr/home/coudert/hist_2d.R PDF result: http://www.eleves.ens.fr/home/coudert/hist_2d.pdf __ 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. __ 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] Collapsing across trials
Try aggregate(DF[4], DF[1:3], mean) On 12/16/06, Pedro Alcocer [EMAIL PROTECTED] wrote: Hello, My ultimate goal is a repeated measures (mixed model) ANOVA, however, my present question is about how to reorganize my data into the format that the ANOVA commands expect. In particular, how to collapse across trials. (I am using the tutorial at [http://personality-project.org/r/r.anova.html] for the mixed model ANOVA) The data I am using looks like this. A subject sees 10 trials per condition and there are 2 conditions. I want the average of all the reaction times (RTs) from a subject looking a one condition. I also want to retain List in the final output. SubjListCondition RT 2 1 C 338 2 1 C 227 2 1 C 430 2 1 C 621 2 1 C 255 2 1 C 348 2 1 C 280 2 1 C 356 2 1 C 272 2 1 C 346 3 2 C 489 3 2 C 426 3 2 C 352 3 2 C 351 3 2 C 349 3 2 C 403 3 2 C 336 3 2 C 278 3 2 C 365 3 2 C 271 2 1 D 360 2 1 D 374 2 1 D 326 2 1 D 363 2 1 D 290 2 1 D 458 2 1 D 295 2 1 D 362 2 1 D 285 2 1 D 277 3 2 D 354 3 2 D 352 3 2 D 362 3 2 D 360 3 2 D 334 3 2 D 365 3 2 D 335 3 2 D 391 3 2 D 272 3 2 D 618 The result should look like this: 2 1 C (AVG) 3 2 C (AVG) 2 1 D (AVG) 3 2 D (AVG) Where (AVG) is the average of the 10 trials. The above is a simplified case. How can I do this with multiple RT measurements per subject? In other words, the above, but with more than one RT column per subject. Resulting in: SubjListCondition RT1 RT2 RT3 RT4 RT5 2 1 C (AVG1) (AVG2) (AVG2) (AVG2) (AVG2) 3 2 C (AVG1) (AVG2) (AVG2) (AVG2) (AVG2) 2 1 D (AVG1) (AVG2) (AVG2) (AVG2) (AVG2) 3 2 D (AVG1) (AVG2) (AVG2) (AVG2) (AVG2) I've come across the apply and aggregate functions in online documentation, and I have the suspicion that they may be called for here, but their application isn't clear to me. I am fairly new to R. (I am using R 2.4.0 on Mac OS X.) I'd appreciate any insights. Pedro Alcocer University of Florida __ 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. __ 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] X11 fonts and Ubuntu
2006/12/17, Patrick Giraudoux [EMAIL PROTECTED]: Hi, I am moving from Windows XP to Ubuntu 6.10 and installed R 2.4.0. When I run eg plot.lm (things work fine with plot.default - eg plot(rnorm(30),rnorm(30))) plot(lmobject) I can get the first plot and then this message: Hit Return to see next plot: Error in text.default(x, y, labels.id[ind],cex=cex, xpd=TRUE, : could not find any X11 fonts Check that the Font Path is correct I have googled through the R-help list and it seems that such troubles already occured sometimes (see link below and threads) http://lists.freebsd.org/pipermail/freebsd-ports/2005-June/024091.html http://tolstoy.newcastle.edu.au/R/help/06/03/23864.html but did not find solution. Some messages claim it is a X11 problem (not R) some others suggest it may come from R. Some also mention that UTF-8 may be a problem (though I don't have specific message on this from R). I have re-installed x11-common via the Synaptic package manager (so I suppose X11 is well installed) without improvement. I have checked /etc/X11/ xorg.conf Section Files FontPath /usr/share/X11/fonts/misc FontPath /usr/share/X11/fonts/100dpi/:unscaled FontPath /usr/share/X11/fonts/75dpi/:unscaled FontPath /usr/share/X11/fonts/Type1 FontPath /usr/share/X11/fonts/100dpi FontPath /usr/share/X11/fonts/75dpi FontPath /usr/share/fonts/X11/misc FontPath /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType Endsection You 'll have to change the /usr/share/X11/fonts/ to /usr/share/fonts/X11/. I have read many having similar problems and solved them this way. The location changed so that all the fonts to be under fonts). So give it a try and I believe that it will be fine. but cannot identify where the problem is actually thus no remedy. Any idea? __ 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. __ 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] Draw a circle on a filled.contour() plot
The output produced by 'filled.contour' is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the 'plot.axes' argument. An example is given below. Thanks! I now have another question (hopefully the last) for which I couldn't find an answer in the mailing-list archives: how can I get rid of the color key on the contour.filled() plot? I that question, unanswered, in a post one year ago on this same list, so I hope it's by any mean possible... (I think it's possible to change the code completely and use image(), but it's much less pretty). FX __ 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] X11 fonts and Ubuntu
Did try it. Works fine now. Just need to reboot after having modified /etc/X11/ xorg.conf as following according to your instructions: Section Files # path to defoma fonts FontPath /usr/share/fonts/X11/misc FontPath /usr/share/fonts/X11/cyrillic FontPath /usr/share/fonts/X11/100dpi/:unscaled FontPath /usr/share/fonts/X11/75dpi/:unscaled FontPath /usr/share/fonts/X11/Type1 FontPath /usr/share/fonts/X11/100dpi FontPath /usr/share/fonts/X11/75dpi FontPath /usr/share/fonts/X11/misc FontPath /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType EndSection Thanks a lot, Patrick Ilias Soumpasis a écrit : 2006/12/17, Patrick Giraudoux [EMAIL PROTECTED]: Hi, I am moving from Windows XP to Ubuntu 6.10 and installed R 2.4.0. When I run eg plot.lm (things work fine with plot.default - eg plot(rnorm(30),rnorm(30))) plot(lmobject) I can get the first plot and then this message: Hit Return to see next plot: Error in text.default(x, y, labels.id[ind],cex=cex, xpd=TRUE, : could not find any X11 fonts Check that the Font Path is correct I have googled through the R-help list and it seems that such troubles already occured sometimes (see link below and threads) http://lists.freebsd.org/pipermail/freebsd-ports/2005-June/024091.html http://tolstoy.newcastle.edu.au/R/help/06/03/23864.html but did not find solution. Some messages claim it is a X11 problem (not R) some others suggest it may come from R. Some also mention that UTF-8 may be a problem (though I don't have specific message on this from R). I have re-installed x11-common via the Synaptic package manager (so I suppose X11 is well installed) without improvement. I have checked /etc/X11/ xorg.conf Section Files FontPath /usr/share/X11/fonts/misc FontPath /usr/share/X11/fonts/100dpi/:unscaled FontPath /usr/share/X11/fonts/75dpi/:unscaled FontPath /usr/share/X11/fonts/Type1 FontPath /usr/share/X11/fonts/100dpi FontPath /usr/share/X11/fonts/75dpi FontPath /usr/share/fonts/X11/misc FontPath /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType Endsection You 'll have to change the /usr/share/X11/fonts/ to /usr/share/fonts/X11/. I have read many having similar problems and solved them this way. The location changed so that all the fonts to be under fonts). So give it a try and I believe that it will be fine. but cannot identify where the problem is actually thus no remedy. Any idea? __ 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. __ 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] Draw a circle on a filled.contour() plot
On 12/17/2006 9:31 AM, Webmaster wrote: The output produced by 'filled.contour' is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the 'plot.axes' argument. An example is given below. Thanks! I now have another question (hopefully the last) for which I couldn't find an answer in the mailing-list archives: how can I get rid of the color key on the contour.filled() plot? I that question, unanswered, in a post one year ago on this same list, so I hope it's by any mean possible... (I think it's possible to change the code completely and use image(), but it's much less pretty). I don't see any option in there, so you might have to write your own version to do it. The source for the regular function is in http://svn.r-project.org/R/trunk/src/library/graphics/R/filled.contour.R and the part that plots the key is ## Plot the 'plot key' (scale): mar - mar.orig mar[4] - mar[2] mar[2] - 1 par(mar = mar) plot.new() plot.window(xlim=c(0,1), ylim=range(levels), xaxs=i, yaxs=i) rect(0, levels[-length(levels)], 1, levels[-1], col = col) if (missing(key.axes)) { if (axes) axis(4) } else key.axes box() if (!missing(key.title)) key.title You'd probably also want to change the layout, because you won't want the blank space there. Or possibly you could get the results you want from contour(), which doesn't plot the scale. Duncan Murdoch __ 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] Draw a circle on a filled.contour() plot
Try levelplot in package lattice instead of filled.contour: you will be able to annotate the plot using the grid package. Moreover, you can remove the key using the colorkey argument. library(lattice) library(grid) z - as.matrix(read.table(hist_2d)) dimnames(z) - NULL Data - expand.grid(x = seq(-4.45, 4.45, len = 90), y = seq(-4.45, 4.45, len = 90)) Data$z - c(z) rm(z) Cols - colorRampPalette(c(white, blue,yellow,red)) levelplot(z ~ x * y, data = Data, aspect = 1, colorkey = FALSE, col.regions = Cols(6), panel = function(...){ panel.levelplot(...) grid.circle(x = 0.62, y = 0, r = 2.5, default.units = native) }) Best, Renaud 2006/12/17, Webmaster [EMAIL PROTECTED]: The output produced by 'filled.contour' is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the 'plot.axes' argument. An example is given below. Thanks! I now have another question (hopefully the last) for which I couldn't find an answer in the mailing-list archives: how can I get rid of the color key on the contour.filled() plot? I that question, unanswered, in a post one year ago on this same list, so I hope it's by any mean possible... (I think it's possible to change the code completely and use image(), but it's much less pretty). FX __ 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. -- Renaud LANCELOT Département Elevage et Médecine Vétérinaire (EMVT) du CIRAD Directeur adjoint chargé des affaires scientifiques CIRAD, Animal Production and Veterinary Medicine Department Deputy director for scientific affairs Campus international de Baillarguet TA 30 / B (Bât. B, Bur. 214) 34398 Montpellier Cedex 5 - France Tél +33 (0)4 67 59 37 17 Secr. +33 (0)4 67 59 39 04 Fax +33 (0)4 67 59 37 95 __ 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.
[R] question
Dear R users, I'am using marray and Limma packages to analyze genepix output. 1) how can I filter bad spots from my data (data contains 3 types of bad spots). my experiment contains 12 samples and the bad spot are not associated to the same probes 2) how can I remove control probes from my data ? I'm sorry, i'm new with R and I can't find answer in packages doc. best regards, Claire Pujoll Paris, France library(marray) library(limma) ... Rawdata - read.GenePix(targets=Macro_Mono_targets,skip=107) design- cbind(individual=c(0,0,1,1,2,2,3,3,4,4,5,5), dim1=c(1,0,1,0,1,0,1,0,1,0,1,0),dim2=c(0,1,0,1,0,1,0,1,0,1,0,1)) fit - lmFit([EMAIL PROTECTED], design) contrast.matrix-makeContrasts(dim1vsdim2=dim2-dim1, levels=design) fit2 - contrasts.fit(fit,contrast.matrix) fiteb - eBayes(fit2) Toptable - topTable(fiteb,number = 10600,genelist=maGeneTable(normdata), sort.by=P, resort.by= M, adjust=BY) write.table(Toptable,file=RNG_Best_1genes.txt, row.names=FALSE, col.names=TRUE, sep=\t) best regards [[alternative HTML version deleted]] __ 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.
[R] question
Dear R users, I'am using marray and Limma packages to analyze genepix output. 1) how can I filter bad spots from my data (data contains 3 types of bad spots). my experiment contains 12 samples and the bad spot are not associated to the same probes 2) how can I remove control probes from my data ? I'm sorry, i'm new with R and I can't find answer in packages doc. best regards, Claire Pujoll Paris, France library(marray) library(limma) ... Rawdata - read.GenePix(targets=Macro_Mono_targets,skip=107) design- cbind(individual=c(0,0,1,1,2,2,3,3,4,4,5,5), dim1=c(1,0,1,0,1,0,1,0,1,0,1,0),dim2=c(0,1,0,1,0,1,0,1,0,1,0,1)) fit - lmFit( [EMAIL PROTECTED], design) contrast.matrix-makeContrasts(dim1vsdim2=dim2-dim1, levels=design) fit2 - contrasts.fit(fit,contrast.matrix) fiteb - eBayes(fit2) Toptable - topTable(fiteb,number = 10600,genelist=maGeneTable(normdata), sort.by=P, resort.by= M, adjust=BY) write.table(Toptable,file=RNG_Best_1genes.txt, row.names=FALSE, col.names=TRUE, sep=\t) best regards [[alternative HTML version deleted]] __ 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.
[R] hblm program: porting from Splus to R
I am replying to the email below my signature; it is nominally about dmp files, but apparently specific to problems with Bill DuMouchel's hblm program. I have been using this program on Splus for years, and ran into some of the same problems Jack did in trying to get it into R. I talked with Bill about it, and he didn't know that there would be any problems; he assumed that R was functionally identical to Splus, and that the program should run. Unfortunately, of course, that's not true. I'm too much of a novice to figure it out, but at least some problems seem to involve scoping rule differences. The NA coercion apparently is something else, perhaps a character being coerced to numeric? As for legal issues, I can try to contact Bill to be sure, but it seems obvious he intends the program to be in the (noncommercial) public domain. The program remains on the ATT web site years after he left, and he seemed perfectly fine with my attempt to port it to R. At one time he had intended to develop a commercial version, but as of the last time I spoke with him (a couple of years ago) that was on permanent hold. If any of you are also interested in hblm, I'd be glad to try to help resolve the technical (and any legal) issues that arise. The program has wonderful graphics for meta-analysis, though others are catching up now. David ___ David Rindskopf Educational Psychology CUNY Graduate Center 365 Fifth Avenue New York, NY 10016 (212) 817-8287 (212) 208-2690 (FAX) Re: [R] Can anyone read a S-PLUS .dmp file for me? Prof Brian Ripley Wed, 06 Dec 2006 05:38:04 -0800 On Wed, 6 Dec 2006, John McHenry wrote: Anyone? Yes, I can read it, but what use is that to you? Given that it is someone else's copyright work, I am not at liberty to redistribute a different version: hblm and associated programs Copyright 1995 by William DuMouchel. Permission is given for not-for-profit redistribution of the hblm programs so long as this About.hblm variable is included unmodified. Please report problems, failures and successes of this program to [EMAIL PROTECTED] The reason for the error is that it appears to contain invalid S data frames. (They are in invalid in R and in current S-PLUS, but they seems also to have been invalid in S3. Restoring dumps used to be one way to create invalid objects, but many of the loopholes have been plugged in R.) John McHenry [EMAIL PROTECTED] wrote:Hi WizaRds, I tried reading the S-PLUS file ftp://ftp.research.att.com/dist/bayes-meta/hblm.dmp into R using data.restore(hblm.dmp) but I got an error: Error in attributes(value) - thelist[-match(c(.Data, .Dim, .Dimnames, : row names must be 'character' or 'integer', not 'double' In addition: Warning message: NAs introduced by coercion Does anyone know how to read this type of S-PLUS file into R? I am not familiar with it. On http://cran.r-project.org/doc/manuals/R-data.html it is suggested that it is usually more reliable to dump the object(s) in S-PLUS and source the dumpfile in R See also, http://tolstoy.newcastle.edu.au/R/help/05/12/18209.html I don't know how this file was created. Could someone with S-PLUS access please see if they can read it? Thanks! Jack. __ 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.
[R] Start Matlab server in R 2.4.0
In order to start matlab server in R , I using the following commands getwd() setwd(D:\R_matlab) install.packages(R.oo) install.packages(R.matlab) install.packages(R.utils) library(R.matlab) Matlab$startServer() a minimized MATLAB Command Window come out, but I can't make this window become larger. Does anyone know why? I type Matlab$startServer() again, I get another MATLAB Command Window and I can maximize this window, From this window: I see such message: To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. Matlab v7.x or higher detected. Saving with option -V6. Added InputStreamByteWrapper to dynamic Java CLASSPATH. -- Matlab server started! -- Trying to open server socket (port )...??? Java exception occurred: java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.init(Unknown Source) at java.net.ServerSocket.init(Unknown Source) . Error in == MatlabServer at 113 server = ServerSocket(port); » Does anyone would like to point out what is reason for these? I am new to R.matlab. I am not sure if this question is too silly. Before I post this question here, I did try to do google search to find answer by myself. But I didn't get point. If this question bother you too much, I am really sorry for this. Thanks, Aimin Yan __ 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.
[R] Find S4 Generic?
How can I get the R code for E in the distrEx package? The function call 'dumpMethods(E, E.R)' created E.R in the working directory. Unfortunately, it apparently contains 0 bytes. Thanks, Spencer Graves __ 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] Draw a circle on a filled.contour() plot
Use my function filled.next: filled.next - function(fun) { mar.orig - mar - par(mar) w - (3 + mar[2]) * par(csi) * 2.54 layout(matrix(c(2, 1), nc = 2), widths = c(1, lcm(w))) mar[4] - 1 par(mar = mar) par(mfg=c(1,2)) par(new=TRUE) fun par(mar = mar.orig) } # then filled.contour(y,x,z,levels=seq(0.02,1.0,len=50), color.palette=colorRampPalette(c(blue,yellow,red)), title=title(main=,xlab=,ylab=)) filled.next(symbols(0.62,0.0,circles=c(2.5),add=TRUE,inches=FALSE)) With plot function in filled.next, don't forget to add xaxs='i', yaxs='i'... Jean Coursol -- Quoting Renaud Lancelot [EMAIL PROTECTED]: Try levelplot in package lattice instead of filled.contour: you will be able to annotate the plot using the grid package. Moreover, you can remove the key using the colorkey argument. library(lattice) library(grid) z - as.matrix(read.table(hist_2d)) dimnames(z) - NULL Data - expand.grid(x = seq(-4.45, 4.45, len = 90), y = seq(-4.45, 4.45, len = 90)) Data$z - c(z) rm(z) Cols - colorRampPalette(c(white, blue,yellow,red)) levelplot(z ~ x * y, data = Data, aspect = 1, colorkey = FALSE, col.regions = Cols(6), panel = function(...){ panel.levelplot(...) grid.circle(x = 0.62, y = 0, r = 2.5, default.units = native) }) Best, Renaud 2006/12/17, Webmaster [EMAIL PROTECTED]: The output produced by 'filled.contour' is actually a combination of two plots; one is the filled contour and one is the legend. Two separate coordinate systems are set up for these two plots, but they are only used internally - once the function has returned these coordinate systems are lost. If you want to annotate the main contour plot, for example to add points, you can specify graphics commands in the 'plot.axes' argument. An example is given below. Thanks! I now have another question (hopefully the last) for which I couldn't find an answer in the mailing-list archives: how can I get rid of the color key on the contour.filled() plot? I that question, unanswered, in a post one year ago on this same list, so I hope it's by any mean possible... (I think it's possible to change the code completely and use image(), but it's much less pretty). FX __ 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. -- Renaud LANCELOT Département Elevage et Médecine Vétérinaire (EMVT) du CIRAD Directeur adjoint chargé des affaires scientifiques CIRAD, Animal Production and Veterinary Medicine Department Deputy director for scientific affairs Campus international de Baillarguet TA 30 / B (Bât. B, Bur. 214) 34398 Montpellier Cedex 5 - France Tél +33 (0)4 67 59 37 17 Secr. +33 (0)4 67 59 39 04 Fax +33 (0)4 67 59 37 95 __ 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. __ 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] Query regarding linking R with Matlab
Hi, what operating system are you on and what version of Matlab do you have? In general you should be able to get started with R.matlab by first installing all required packages from CRAN: install.packages(c(R.oo, R.utils, R.matlab)) Then load the package: library(R.matlab) From there just follow the example in help(Matlab): # Create a Matlab client matlab - Matlab(host=localhost, port=9998) # Connect to the Matlab server if (!open(matlab)) throw(Matlab server is not running: waited 30 seconds.) # Run Matlab expressions on the Matlab server res - evaluate(matlab, A=1+2;, B=ones(2,20);) # Get Matlab variables data - getVariable(matlab, c(A, B)) cat(Received variables:\n) str(data) ... # When done, close the Matlab client, which will also shutdown # the Matlab server and the connection to it. close(matlab) Hope this helps Henrik On 12/15/06, Bhanu Kalyan.K [EMAIL PROTECTED] wrote: Thank you sir for your prompt reply. Currently i am stuck at point where I need to call an available Matlab program from an R 2.4.0 interface. How can I do this? I have downloaded the R.matlab file and also the manual in pdf. But still i am not able to get through the problem. I will be grateful to you if you can elaborate me on this. Awaiting your reply, regards, Bhanu Kalyan K Bhanu Kalyan K BTech CSE Final Year [EMAIL PROTECTED] Tel :+91-9885238228 __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ 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] Start Matlab server in R 2.4.0
Hi. On 12/18/06, Aimin Yan [EMAIL PROTECTED] wrote: In order to start matlab server in R , I using the following commands getwd() setwd(D:\R_matlab) install.packages(R.oo) install.packages(R.matlab) install.packages(R.utils) library(R.matlab) Matlab$startServer() a minimized MATLAB Command Window come out, but I can't make this window become larger. Does anyone know why? You can change this, by calling Matlab$startServer(minimize=FALSE) On Windows, Matlab is started minimized by default, because the information in that window is of no interest (except for debugging) and you cannot type anything in that window anyway. However, read further... I type Matlab$startServer() again, I get another MATLAB Command Window and I can maximize this window, From this window: I see such message: To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. Matlab v7.x or higher detected. Saving with option -V6. Added InputStreamByteWrapper to dynamic Java CLASSPATH. -- Matlab server started! -- Trying to open server socket (port )...??? Java exception occurred: java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.init(Unknown Source) at java.net.ServerSocket.init(Unknown Source) . Error in == MatlabServer at 113 server = ServerSocket(port); » Does anyone would like to point out what is reason for these? The reason for this is that you already started one Matlab session using (default) port . When you start the second one, the error message (from Java) says that that port is already taken. So this is expected. However, I am not sure why you can't maximize the first, but the second. Odd. However, ... I am new to R.matlab. I am not sure if this question is too silly. Before I post this question here, I did try to do google search to find answer by myself. But I didn't get point. If this question bother you too much, I am really sorry for this. You do not have to start the Matlab server explicitly like this; instead setup a Matlab object in R as illustrated in the help(R.matlab) example and the server will be started when you call open() on that object, e.g. matlab - Matlab(host=localhost, port=9998) if (!open(matlab)) throw(Matlab server is not running: waited 30 seconds.) # If you get here, you have a working R-Matlab connection BCD - matrix(rnorm(1), ncol=100) setVariable(matlab, ABCD=ABCD) # Send to Matlab data - getVariable(matlab, ABCD) # Receive from Matlab str(data) The open() call will call Matlab$startServer() for you, and on Windows it will be minimized, so in that sense there is no change. But again, there is not much for you to see there. Hope this helps Henrik Thanks, Aimin Yan __ 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. __ 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.
[R] fischer.test help
Hi there, I´m trying to follow the reading of the book The Nature of Scientific Evidence (by Mark Taper and Subhash Lele) using R. I would like to preparar R scritps from the exercises of this book available to world wide community. To do so, I will need some help of our R-helpers; On this book, the author proposed we use Fisher´s p-value tests for a pig sex rate = 0.5 from observed male=7929 and female 8304 (total = 16233). The authors sad Under the assumed binomial distribution, the probability of observing 7929 male is .823; any observation with fewer than 7929 or more than 8303 males will have a probability less than or equal to .8233 and thus be considered an extreme event. They also sad Summing the probability of all extreme events, we find that probability of observing an event as extrem as or more extreme than the observed 7929 males is 0.003331. How can a reach up these same p-values? Kind regards, Miltinho Brazil __ [[alternative HTML version deleted]] __ 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] Find S4 Generic?
Do you want E (type 'E') or its methods (getMethods(E) works for me)? On Sun, 17 Dec 2006, Spencer Graves wrote: How can I get the R code for E in the distrEx package? The function call 'dumpMethods(E, E.R)' created E.R in the working directory. Unfortunately, it apparently contains 0 bytes. See ?dumpMethods: you need to specify 'where' (as it says you may). -- 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 __ 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] fischer.test help
Milton Cezar Ribeiro wrote: Hi there, I´m trying to follow the reading of the book The Nature of Scientific Evidence (by Mark Taper and Subhash Lele) using R. I would like to preparar R scritps from the exercises of this book available to world wide community. To do so, I will need some help of our R-helpers; On this book, the author proposed we use Fisher´s p-value tests for a pig sex rate = 0.5 from observed male=7929 and female 8304 (total = 16233). The authors sad Under the assumed binomial distribution, the probability of observing 7929 male is .823; any observation with fewer than 7929 or more than 8303 males will have a probability less than or equal to .8233 and thus be considered an extreme event. They also sad Summing the probability of all extreme events, we find that probability of observing an event as extrem as or more extreme than the observed 7929 males is 0.003331. How can a reach up these same p-values? dbinom, pbinom, binom.test (This is an exact test in the binomial distribution, not what is commonly known as Fisher's exact test, which is for independence in a 2x2 table.) Kind regards, Miltinho Brazil __ [[alternative HTML version deleted]] __ 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. __ 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.
[R] surface3d grid from xyz dataframe
Hi List, I am trying to plot a grid with an overlayed height. I have a dataframe with four variables: x,y,gridvalue,height. The dataframe has 2.5mio observations (ie grid points), I assign colors through the gridvalue using map_color_gradient thus producing: x,y,gridvalue,height,gridcol as variables of the dataframe. The grid dimensions are 1253 x 2001 (=2507253 data points). My attempts with surface3d fail, mainly because I cannot produce the matrix required for the height input. elev.to.list{CTFS} fails with: Error in matrix(elevfile$elev, nrow= 1+ydim/gridsize, ncol=1+xdim/gridsize. : attempt to set an attribute on NULL which I assume means it requires a square grid (=quadrates). Any ideas/help appreciated Thanks Herry Dr Alexander Herr Spatial and statistical analyst CSIRO, Sustainable Ecosystems Davies Laboratory, University Drive, Douglas, QLD 4814 Private Mail Bag, Aitkenvale, QLD 4814 Phone/www (07) 4753 8510; 4753 8650(fax) Home: http://herry.ausbats.org.au Webadmin ABS: http://ausbats.org.au Sustainable Ecosystems: http://www.cse.csiro.au/ __ 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] surface3d grid from xyz dataframe
On 12/17/2006 7:56 PM, [EMAIL PROTECTED] wrote: Hi List, I am trying to plot a grid with an overlayed height. I have a dataframe with four variables: x,y,gridvalue,height. The dataframe has 2.5mio observations (ie grid points), I assign colors through the gridvalue using map_color_gradient thus producing: x,y,gridvalue,height,gridcol as variables of the dataframe. The grid dimensions are 1253 x 2001 (=2507253 data points). My attempts with surface3d fail, mainly because I cannot produce the matrix required for the height input. elev.to.list{CTFS} fails with: Error in matrix(elevfile$elev, nrow= 1+ydim/gridsize, ncol=1+xdim/gridsize. : attempt to set an attribute on NULL which I assume means it requires a square grid (=quadrates). When you are asking a question about a function from a contributed package, please state which package you found it in. There's a surface3d function in the rgl package; is that the one you're using? It takes input in the same format as contour() uses. That is: the x values should be a vector of values corresponding to the rows of a matrix, the y values correspond to the columns, the z values are in a matrix. Since your data is in a dataframe, it's not the right shape. How to get it into the right shape depends a lot on what the pattern of your data really is. Do you have a relatively small number of x and y values, corresponding to rows and columns, or are they scattered over the region? If the former, I'd convert them to integer values marking the positions, then use those to index into a matrix to place the z values there. e.g. with data like this: x y z 1 1 1 1 2 2 2 1 3 2 2 4 the x and y values are already integer valued, so you could use x - sort(unique(data$x)) y - sort(unique(data$y)) z - matrix(NA, length(x), length(y)) z[cbind(data$x, data$y)] - data$z Duncan Murdoch __ 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.
[R] Rmath: R libraries from C on Mac OS X
Dear R-experts, I have been having trouble using R's standalone random number generators from C on my Mac OS X 10.4.8 system. I try to compile my C program in the following way: gcc -Wall -o helloMac helloMac.c -lm -lRmath I get the following error: /usr/bin/ld: can't locate file for: -lRmath I am unable to locate Rmath on my machine. The problem appears to be that no libRmath.a was built on my Mac OS X installation. Any pointers (perhaps to a step by step guide for a _beginner_ on how to install this and then how to compile the C code) would be most appreciated.For completeness, here is my C code (adapted from code that works fine on Linux): #includestring.h #includestdio.h #includestdlib.h #define MATHLIB_STANDALONE 1 #include /Library/Frameworks/R.framework/Versions/2.3/Resources/include/i386/Rmath.h int main(int argc, char *argv[]) { printf(hello world\n); printf(%lf\n,rnorm(5,2)); return(0); } Many thanks in advance. Murali __ 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.
[R] proc GLM with R
I want to migrate from SAS to R. I used proc mixed to do comparison between multiple groups and to perform multiple comparison between groups since, as far as I know, proc mixed does not make assumptions about the data and so it is better than a simple anova (data must only be normal). Es. how can I translate a code like this (two way anova with a factor of repetition) : proc mixed; class kind PEEP codice; model PaO2_FiO2 = kind PEEP kind*PEEP; repeated /type = un sub=codice; lsmeans kind*PEEP /adjust=bon; run; codice is a unique identifier of patient kind is a variable which subdivided the patient (i.e. red or brown hairs) PEEP is positive end expiratory pressure. These are the steps of a clinical trial. Patient did the trial at PEEP = 5 and PEEP = 10 Thank you Massimo Cressoni run; __ 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] Rmath: R libraries from C on Mac OS X
On 17 December 2006 at 23:19, Murali Haran wrote: | I have been having trouble using R's standalone random number generators | from C on my Mac OS X 10.4.8 system. | | I try to compile my C program in the following way: | gcc -Wall -o helloMac helloMac.c -lm -lRmath | I get the following error: | /usr/bin/ld: can't locate file for: -lRmath | | I am unable to locate Rmath on my machine. The problem appears to be | that no libRmath.a was built on my Mac OS X installation. | | Any pointers (perhaps to a step by step guide for a _beginner_ on how to | install this and then how to compile the C code) would be most | appreciated.For completeness, here is my C code (adapted from code that | works fine on Linux): As you indicate yourself, the issue is presumably that there is no libRmath. So you need to build one. For the Debian/Ubuntu packages, we do the following: # make standalone math lib (cd src/nmath/standalone; \ $(MAKE) CFLAGS=$(cflags) -D_REENTRANT \ CXXFLAGS=$(cxxflags) -D_REENTRANT \ FFLAGS=$(fcflags) -D_REENTRANT\ CC=${compiler} \ CXX=${cxxcompiler} \ ${fortrancompiler} \ libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \ ) I would expect that you need to do a similar $ cd src/nmath/standalone make along with whichever flags you may need. Details can surely be found in the 'R Admin' manual you may want to consult for this. Hth, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison __ 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.
[R] Replacing labels with symbols in biplot
Dear all I would like to replace labels for x in biplot() with symbols (points) that will visually illustrate different classes/groups. After an unsuccessful search through the documents and archives, I turn to the list for help - any suggestions that can point me in the right direction? Thanks Mat Vanderklift __ 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.