[R] display data ( text) on leveplot / Superpose panel
I am trying to display data ion top of colored rectangle on the same levelplot. While using superpose the shape and symbol for levelplot changes to small circle. I am unable to figure what exactly I am doing wrong... It may be straightforward solution... .I will appreciate help to fix this issue. brewer.div-colorRampPalette(c(pink,green,blue,yellow,red), interpolate=linear)levelplot(ds, shrink=c(0.9,1), aspect=3/5, scales=list(x=list(rot=0)), cuts = 10, col.regions = brewer.div(20), xlab=, ylab= , main= , panel = function(x,y,z,...) { panel.superpose(x,y,z,...) ltext(x,y,paste(z), adj=c(0,2), cex=.8, col='black')} ) where ds is matrix pct20 pct40 pct60 pct80 pct100A1618 6 2 0C1911 7 0 0D 916 2 0 0E 135 9 0 0 0J9057 3 1 0M4717 1 0 0T19 9 3 1 0 ThanksKulwinder Banipal _ Hotmail® goes with you. ial_Mobile1_052009 [[alternative HTML version deleted]] __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
Homework?... Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Fri, May 8, 2009 at 12:19 PM, ayaku1...@gmail.com ayaku1...@gmail.com wrote: There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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@r-project.org 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] dyn.load a package for dev purposes?
Hi, I don't seem to be able to get a package to detach and reload in my debugging R session once I have already loaded it. R CMD REMOVE -l /usr/lib64/R/library quantmod R CMD build /home/user1/eclipse/workspace/quantmod/; R CMD INSTALL -l /usr/lib64/R/library quantmod_0.3-7.tar.gz in R... detach(package:mypackage1) library(mypackage1) doStuffFromMypackage1(something); if I reload the session, then the changes are reflected. I noticed the dyn.load function, is there something there I can do to reload the package without restarting the session? Thanks, #T __ R-help@r-project.org 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] PGF Device
Dear Cameron, thanks for that message and your effort. I'm really glad to hear this. Lasse Am Donnerstag, den 07.05.2009, 15:09 -0700 schrieb cameron.bracken: baptiste auguie-2 wrote: I think the pgfSweave project on R-forge is working on this (as far as i know it currently relies on eps2pgf) Hi- I am one of the developers of pgfSweave. This is correct, pgfSweave currently relies on eps2pgf. Our goal for the summer is to develop a pgf device. This will help with performance as well as the eps conversion problems that some have referred to. -- Lasse Bombien Institut für Phonetik und Sprachverarbeitung Schellingstraße 3/II D-80799 München email: la...@phonetik.uni-muenchen.de web: http://www.phonetik.uni-muenchen.de/~lasse phone: +49 (0) 89 2180 2812 __ R-help@r-project.org 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] How to run regression of ordinal probit with IV
Dear Sir I have a technical problem on an ordinal probit regression with IV. In the first stage, my dependent variable is dummy variable. I predict this endogenous variable,and the predict value is continuous. However, my model in the second stage is DID model, that is this endogenous variable must be dummy. So, I don’t know how to solve this problem. Thanks LI,Nan email.liyiy...@ust.hk Room B301c,UA Tower B Hong Kong University of Science and Technology Clearwater Bay, Kowloon, Hong Kong __ R-help@r-project.org 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] creation of a matrix
Hi all, I have a relative large amount (several thousand rows, but a small amount of unique objects) of data in a format like this: 1 text_string 1 text_string 1 text_string 2 text_string 2 text_string 3 text_string 3 text_string 3 text_string 3 text_string 3 text_string . . . n text_string I want to create an n x p matrix, n objects (=40) and p unique text strings. Nij is number of occurrences of a text string j in object i. What is the most efficient way of creating this matrix? Best regards, Erika Ahl __ R-help@r-project.org 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] 'Dynamic' 3D plot
Hi, I am looking for a R package to draw 3d plot. But not in a static way like scatterplot3d or stuff like that. I would like to make rotate the plot, to zoom/unzoom etc..., actually to render the graph 'dynamic'... (for the biologist and bioinformatician, a R package which permitts to reproduce what pdb viewer does). Does a Way exist to do something like that in R ? Thanks, _ Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! [[alternative HTML version deleted]] __ R-help@r-project.org 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] I updated/reinstalled ggplot2 and the trouble started...
Dear Tena, As I am a WinXP user I have no expercience with Linux. I would suggest you try the plot on a pdf device. pdf does support transparancy (at least on windows and for pdf version = 1.4). HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey Van: Tena Sakai [mailto:tsa...@gallo.ucsf.edu] Verzonden: donderdag 7 mei 2009 18:13 Aan: ONKELINX, Thierry; Ian Fellows; r-help@r-project.org Onderwerp: RE: [R] I updated/reinstalled ggplot2 and the trouble started... Hi, What device are you using to plot the graph? I am not explicitly specifying any. I am on redhat linux and as I understand it R uses DISPLAY environment variable, which is set for an X11 server (X Darwin, v1.4.0, X11 6.8.2). Other qplot()'s I have used (straight out of the book) work fine. I am coming to believe that before the current incarnation, it simply ignored the alpha parameter and gave the plot, whereas with the latest it doens't want to ignore and not going further. I'd be curious if this problem is reproducible with anybody else. Regards, Tena Sakaki tsa...@gallo.ucsf.edu -Original Message- From: ONKELINX, Thierry [mailto:thierry.onkel...@inbo.be] Sent: Thu 5/7/2009 1:01 AM To: Tena Sakai; Ian Fellows; r-help@r-project.org Subject: RE: [R] I updated/reinstalled ggplot2 and the trouble started... What device are you using to plot the graph? According to the warning, the device is causing the problem. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Tena Sakai Verzonden: donderdag 7 mei 2009 6:22 Aan: Ian Fellows; r-help@r-project.org Onderwerp: Re: [R] I updated/reinstalled ggplot2 and the trouble started... Hi Ian, Per your suggestion, I reinstalled R 2.9.0, then I reinstalled ggplot2 on top. The problem persists. Here's the what happens after the installation: qplot (carat, price, data = diamonds, alpha = I(1/10)) Warning message: In grid.Call.graphics(L_points, x$x, x$y, x$pch, x$size) : semi-transparency is not supported on this device: reported only once per page The entire record of installing ggplot2 package, ending up with the line above is in the attached file. I would think this should be reproducible with anybody else. If you have any other suggestion, I am all ears. Regards, Tena Sakai tsa...@gallo.ucsf.edu -Original Message- From: Ian Fellows [mailto:ifell...@gmail.com] Sent: Tue 5/5/2009 11:43 PM To: Tena Sakai Subject: Re: I updated/reinstalled ggplot2 and the trouble started... Tena, May I suggest that you do a full clean install of R 2.9.0, then install ggplot2 from cran. See if the problem persists after that. Ian On Tue, May 5, 2009 at 11:13 PM, tena tsa...@gallo.ucsf.edu wrote: Hi Hadley, Many thanks for your reply. I followed your instruction and got past the point where I was stuck at. Namely, I was able to generate a few plots. But as I came to the second half of section 2.4, where I wanted to see the behavior of alpha paramter, which I had apparently misspelled, I encountered another hindrance: qplot (carat, price, data = diamonds, alpha = I(1/10)) Warning message: In grid.Call.graphics(L_points, x$x, x$y, x$pch, x$size) : semi-transparency is not supported on this device: reported only once per page A plot was generated, but there are tic marks and labels on
[R] Get (feature, threshold) from Output of rpart() for Stump Tree
Hi, I have a question regarding how to get some partial information from the output of rpart, which could be used as the first argument to predict. For example, in my code, I try to learn a stump tree (decision tree of depth 2): fit - rpart(y~bx, weights = w/mean(w), control = cntrl) print(fit) btest[1,] - predict(fit, newdata = data.frame(bx)) I found that fit is of mode list and length 12. If I print(fit), I will get as output: n= 124 node), split, n, deviance, yval * denotes terminal node 1) root 124 61.54839 0.7096774 2) bx.21 13.5 41 40.39024 0.1219512 * 3) bx.21=13.5 83 0.0 1.000 * I don't want the whole output of print(fit) but only the two kinds of info in it: 21 in bx.21, which I believe to be the feature ID of the stump tree , and 13.5, which I believe to be the threshold on the feature. If I am able to get these two out, then I will be able to further process them or write them into a file. Any hint? Thanks and regards! -Tim [[alternative HTML version deleted]] __ R-help@r-project.org 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] What package I use to draw 3D plot after plsda?
Hi, You want something like this? library (pls) data(yarn) library (scatterplot3d) yarn.pls - plsr(density ~ NIR, 6, data = yarn, validation = CV) palette (rainbow(length(yarn$density))) scatterplot3d (yarn.pls$scores[,1:3],pch=16,color=1:length(yarn$density),cex.symbols=2) ?scatterplot3d B.R Andris On Fri, May 8, 2009 at 9:07 AM, yongkook Kwon yongkookk...@gmail.com wrote: Hi. I was used to draw 2D plot to show distribution of my samples. It was very powerful in small samples. Recently , I handle a lot of type of samples as more 15. so, I want to use more dimention. I was used that I conduct plsda function and draw biplot, such as, p1=plsda(mw, sp) biplot(p1) How can I draw 3D graph with my data?? I don't know exactly numerical value each spot. please, help me. [[alternative HTML version deleted]] __ R-help@r-project.org 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@r-project.org 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] Plotting questions
Hi, I am new to R. I have two questions about plotting in R: 1. How to plot several lines in a figure? Suppose I have several sets of points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1) will give a line connecting these points. Another plot(x2,y2) will erase what plot before and plot the new line. Can I have these lines all drawn in the same figure? 2. How to open another figure window? Repeating plot will redraw in the same window instead of opening another one. Thanks and regards! -Tim -- View this message in context: http://www.nabble.com/Plotting-questions-tp23442445p23442445.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
On 08/05/2009 2:27 AM, Yihui Xie wrote: Homework?... Looks like it, and also what we call academic misconduct here. It would be enough to get a student expelled... Duncan Murdoch Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Fri, May 8, 2009 at 12:19 PM, ayaku1...@gmail.com ayaku1...@gmail.com wrote: There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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] glm fit
Hi, I try to ask here, because I hope someone will help me understand this problem- I have fittet a glm in R with the results glm1 - glm(log(claims)~log(sum)*as.factor(grp),family=gaussian(link=identity)) summary(glm1) Call: glm(formula = log(claims) ~ log(sum) * as.factor(grp), family = gaussian(link = identity)) Deviance Residuals: Min 1Q Median 3Q Max -6.6836 -1.3626 -0.2576 1.2038 8.2480 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 3.525657 0.436102 8.084 8.18e-16 *** log(sum)0.334288 0.025668 13.024 2e-16 *** as.factor(grp)2 0.434262 0.976240 0.445 0.6565 as.factor(grp)3 3.666490 1.436471 2.552 0.0107 * as.factor(grp)4 0.040782 1.024730 0.040 0.9683 log(sum):as.factor(grp)2 0.007719 0.061914 0.125 0.9008 log(sum):as.factor(grp)3 -0.209986 0.091578 -2.293 0.0219 * log(sum):as.factor(grp)4 0.059342 0.067320 0.881 0.3781 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for gaussian family taken to be 3.693731) Null deviance: 15839 on 4035 degrees of freedom Residual deviance: 14878 on 4028 degrees of freedom AIC: 16737 Number of Fisher Scoring iterations: 2 But i'm not sure what I get out of the summary. What does it tell me? How should the formula for Y look like, out from the summary? Is it something like Y=0.334288*X_sum+0.434262*X_2+ ?? And when I get a expression for Y, what does it tell me? Is it an expected expression? Can anyone help me please? -- View this message in context: http://www.nabble.com/glm-fit-tp23443121p23443121.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
ayaku1...@gmail.com wrote: There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! If I'd read such a message from one of my students .@._$%§!! Uwe Ligges __ R-help@r-project.org 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@r-project.org 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] Comparing elements of a vector, grouped by values in other vector.
Hi, I have the following vectors: v1 - rep( LETTERS[ 1:4 ], each = 5) v2 - c( letters[ 1:10 ], letters[ 1:10 ] ) Notice that: tapply( B, A, I ) $A [1] a b c d e $B [1] f g h i j $C [1] a b c d e $D [1] f g h i j Here we can see there are two groups of values: *abcde* and *fghij*. This two groups can have elements in different order so: *abcde* is consider in the same group as *ebcda*. I want to obtain the following information: There are two groups in vector *v2*, corresponding to levels A and C in vector *v1* Any idea? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org 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] Plotting questions
1. How to plot several lines in a figure? Suppose I have several sets of points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1) will give a line connecting these points. Another plot(x2,y2) will erase what plot before and plot the new line. Can I have these lines all drawn in the same figure? #Draw your plot plot(seq(0,1,length.out=20)) #Add lines to the existing plot lines(runif(20)) #Add points to the existing plot points(runif(20), col=red) 2. How to open another figure window? Repeating plot will redraw in the same window instead of opening another one. On Windows, windows() will open a new figure window; quartz() on Mac OSX and x11() on Linux do the same. Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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] graph resolution windows (dpi) using x11 device
Dear list members, After looking in the www, I found this subject has been in discussion previously on the mailing list, although I could not solve it. I also found two wikis, but similarly, could not reach a conclusion. I need to re-produce my figures with 1200 dpi, in tiff format, for a journal (off course :-s). I am working on windows xp professional, R version 2.7.1, using x11 to open device and do the graphs. Than, I generally use both print.plot or savePlot, but nether permitted me to change the resolution... When I do it through tiff() function, the graph produced is very different from the one plotted on the current device (similar to pdf, eps, etc.). The graphs are a bit complex, have many variables, parts and bits, legends, etc. so it would be important to save as it is observed in the current windows device... So, I have two questions: 1. Is there any way to save the graph done in the open x11 device with greater resolution than 72dpi? 2. Is there any way to change this default under windows, so that from now on every time I do a figure, it will be with greater resolution (I image it should be possible through windows.options... but no ideia how)? Any help, will be greatly appreciated, Thanks in advance, Best wishes, Marta __ R-help@r-project.org 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] increasing memory for R bg job
if (typeof YAHOO == undefined) { var YAHOO = {}; } YAHOO.Shortcuts = YAHOO.Shortcuts || {}; YAHOO.Shortcuts.hasSensitiveText = false; YAHOO.Shortcuts.sensitivityType = []; YAHOO.Shortcuts.doUlt = false; YAHOO.Shortcuts.location = us; YAHOO.Shortcuts.document_id = 0; YAHOO.Shortcuts.document_type = ; YAHOO.Shortcuts.document_title = increasing memory for R bg job; YAHOO.Shortcuts.document_publish_date = ; YAHOO.Shortcuts.document_author = wht_...@yahoo.com; YAHOO.Shortcuts.document_url = ; YAHOO.Shortcuts.document_tags = ; YAHOO.Shortcuts.document_language = english; YAHOO.Shortcuts.annotationSet = { lw_1241780818_0: { text: http://stat.ethz.ch/R-manual/R-patched/library/base/html/Memory.html;, extended: 0, startchar: 359, endchar: 426, start: 359, end: 426, extendedFrom: , predictedCategory: , predictionProbability: 0, weight: 1, relScore: 0, type: [shortcuts:/us/instance/identifier/URL], category: [IDENTIFIER], wikiId: , relatedWikiIds: [], relatedEntities: [], showOnClick: [], context: job is run? R --min-vsize=vl --max-vsize=vu --min-nsize=nl --max-nsize=nu --max-ppsize=N source: http://stat.ethz.ch/R-manual/R-patched/library/base/html/Memory.html Thx Carol, metaData: { visible: true } } }; YAHOO.Shortcuts.headerID = 0e4a94dc6010f1b6cb21afbed1a44d69; Hi, Is the following command used to increase the memory or any other command when a background R job is run? R --min-vsize=vl --max-vsize=vu --min-nsize=nl --max-nsize=nu --max-ppsize=N source: http://stat.ethz.ch/R-manual/R-patched/library/base/html/Memory.html Thx Carol [[alternative HTML version deleted]] __ R-help@r-project.org 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] Episode splitting with qualitative covariates
Dear R-users, To test the effect of training (a time-varying qualitative covariate) on the transition to management rate by means of event history models, I would like to split my data by the training date. Excerpt of my data: StatusN Duration DummyOtherEp TimingOtherTraining 1 0 11780 1 2 1 450 1 3 1 12090 1 4 1 22351 250 5 0 24110 1 With: - StatusN: event (=1) or right-censored (=0). - Duration: time until the transition to management or until the end date of data collection. - DummyOtherEp: whether someone had training during the episode (=1). - Timing other training: training date relative to the beginning of the episode (employees without training received the value 1). I tried to use survSplit to do the episode splitting, but that does not work. E.g.: split1 -survSplit(babyfile,cut=TimingOtherTraining, end=Duration, event=StatusN, start=start, episode=i) Does anyone know how to split episodes with qualitative covariates in R? Thanks in advance. Marleen Damman __ R-help@r-project.org 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] 'Dynamic' 3D plot
Hi Martial, The rgl package is quite nice for this sort of thing: # this is the example in ?plot3d library(rgl) open3d() x - sort(rnorm(1000)) y - rnorm(1000) z - rnorm(1000) + atan2(x,y) plot3d(x, y, z, col=rainbow(1000)) HTH, Tony Breyal On 8 May, 09:25, Martial Sankar martial100...@hotmail.com wrote: Hi, I am looking for a R package to draw 3d plot. But not in a static way like scatterplot3d or stuff like that. I would like to make rotate the plot, to zoom/unzoom etc..., actually to render the graph 'dynamic'... (for the biologist and bioinformatician, a R package which permitts to reproduce what pdb viewer does). Does a Way exist to do something like that in R ? Thanks, _ Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! [[alternative HTML version deleted]] __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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] Error while using rfImpute
Dear Administrator, I am using linux (suse 10.2). While attempting rfImpute, I am getting the following error message: Members - rfImpute(Status ~ ., data = Members) Error in .C(classRF, x = x, xdim = as.integer(c(p, n)), y = as.integer(y), : C symbol name classRF not in DLL for package randomForest. I need the help to sort out above error. Thanks a lot Regards Mradul [[alternative HTML version deleted]] __ R-help@r-project.org 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] CHM error
tognox wrote: Hi, I would need some help in solving a problem with my R. Whenever I try to type ?paste or in general any command for the html help in R, I receive this error message. The strange thing is that I have never had this kind of problem in the past with R, and now I really don't understand why it says that. Also I have selected every single element in the installation process. The message is this one: Error in print.help_files_with_topic(D:/Programmi/R/R-2.9.0/library/base/chm/print) : CHM file could not be displayed I would really appreciate some suggestion. Thanks very much. Since some security concerns with chm files have been published: your admin might have disabled chm interpretation by Windows or some other software is blocking chm files. Or perhaps the file is corrupted and needs to be reinstalled? The relevant one is D:/Programmi/R/R-2.9.0/library/base/chtml/base.chm Uwe Ligges __ R-help@r-project.org 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] creation of a matrix
Is this what you want: x - data.frame(n=sample(10, n, TRUE), text=sample(LETTERS, n, TRUE)) table(x$text, x$n) 1 2 3 4 5 6 7 8 9 10 A 6 5 2 0 8 1 5 3 6 4 B 2 2 5 2 2 7 5 4 4 5 C 7 4 6 4 3 6 3 6 5 4 D 9 5 1 6 3 1 3 2 6 3 E 2 6 4 3 3 5 2 7 6 3 F 6 5 3 5 3 5 1 2 2 10 G 4 4 2 5 5 3 2 7 3 3 H 4 4 4 5 3 3 3 6 3 4 I 9 3 6 1 4 4 3 4 3 4 J 4 7 3 4 3 3 4 1 2 5 K 2 5 5 3 3 6 9 6 5 3 L 3 3 5 4 3 3 3 3 5 5 M 3 9 2 3 2 0 2 3 5 6 N 4 1 0 5 8 4 4 3 6 2 O 3 4 3 4 8 4 2 5 5 4 P 3 6 2 6 4 4 3 4 3 6 Q 5 2 2 5 3 3 0 2 5 4 R 1 5 6 4 5 4 2 2 4 4 S 6 2 4 2 1 7 0 1 1 2 T 4 3 1 7 2 3 4 1 8 1 U 4 5 11 8 3 2 5 3 4 5 V 6 3 1 1 1 0 2 5 5 3 W 3 5 1 4 4 5 6 3 4 2 X 5 4 3 5 5 6 3 3 3 6 Y 6 6 6 3 2 1 3 4 4 1 Z 3 6 1 5 6 1 8 1 3 4 On Fri, May 8, 2009 at 4:48 AM, Erika Ahl erika@gmail.com wrote: Hi all, I have a relative large amount (several thousand rows, but a small amount of unique objects) of data in a format like this: 1 text_string 1 text_string 1 text_string 2 text_string 2 text_string 3 text_string 3 text_string 3 text_string 3 text_string 3 text_string . . . n text_string I want to create an n x p matrix, n objects (=40) and p unique text strings. Nij is number of occurrences of a text string j in object i. What is the most efficient way of creating this matrix? Best regards, Erika Ahl __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] __ R-help@r-project.org 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] graph resolution windows (dpi) using x11 device
Marta M. Rufino wrote: Dear list members, After looking in the www, I found this subject has been in discussion previously on the mailing list, although I could not solve it. I also found two wikis, but similarly, could not reach a conclusion. I need to re-produce my figures with 1200 dpi, in tiff format, At least I cannot even set this resolution in the original tiff device. Hence I'd suggest to produce some vector format such as postscript or pdf and convert with some third party software to the desired tiff specification afterwards. Uwe Ligges for a journal (off course :-s). I am working on windows xp professional, R version 2.7.1, using x11 to open device and do the graphs. Than, I generally use both print.plot or savePlot, but nether permitted me to change the resolution... When I do it through tiff() function, the graph produced is very different from the one plotted on the current device (similar to pdf, eps, etc.). The graphs are a bit complex, have many variables, parts and bits, legends, etc. so it would be important to save as it is observed in the current windows device... So, I have two questions: 1. Is there any way to save the graph done in the open x11 device with greater resolution than 72dpi? 2. Is there any way to change this default under windows, so that from now on every time I do a figure, it will be with greater resolution (I image it should be possible through windows.options... but no ideia how)? Any help, will be greatly appreciated, Thanks in advance, Best wishes, Marta __ R-help@r-project.org 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@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-help@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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@r-project.org 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] extending strsplit to handle missing text that doesn't have the target on which to split
Find the values that are missing a comma and add it: dat - c(Tue, 15 Nov 2005 09:44:50 EST, + 15 Nov 2005 09:10:00 +0100, + Tue, 15 Nov 2005 09:44:50 EST, + Tue, 15 Nov 2005 16:29:57 +, + Wed, 16 Nov 2005 07:00:45 EST, + Wed, 16 Nov 2005 05:28:00 -0800, + Wed, 16 Nov 2005 14:06:21 +, + 15 Nov 2005 09:10:00 +0100) # add comma if missing missing - !grepl(',', dat) dat[missing] - paste('', dat[missing], sep=',') tmp.dat.data - matrix(unlist(strsplit(dat,,)),ncol = 2, byrow = TRUE) tmp.dat.data [,1] [,2] [1,] Tue 15 Nov 2005 09:44:50 EST [2,] 15 Nov 2005 09:10:00 +0100 [3,] Tue 15 Nov 2005 09:44:50 EST [4,] Tue 15 Nov 2005 16:29:57 + [5,] Wed 16 Nov 2005 07:00:45 EST [6,] Wed 16 Nov 2005 05:28:00 -0800 [7,] Wed 16 Nov 2005 14:06:21 + [8,] 15 Nov 2005 09:10:00 +0100 On Thu, May 7, 2009 at 9:30 AM, Chris Evans chrish...@psyctc.org wrote: I am sure there is an obvious answer to this that I'm missing but I can't find it. I'm parsing headers of Emails and most have a date like this: Wed, 16 Nov 2005 05:28:00 -0800 and I can parse that using: tmp.dat.data - matrix(unlist(strsplit(headers$Date.line,,)), ncol = 2, byrow = TRUE) before going on to look at the day and date/time data. However, a very few headers I want to parse are missing the initial day of the week and look like this: 15 Nov 2005 09:10:00 +0100 That means that my use of strsplit() results in that date/time part being all of the item in the list for those entries so the effect of matrix(unlist()) is to pull the next list entry up in the matrix. Because I happened to have only two errant entries I didn't see what was happening for a moment. (An odd number gives a warning message about dimensions not fitting but an odd number has silently moved things up/left so doesn't: no quarrel with that from me, my stupidity that I was slow to see what was happening!) I'm sure I should be able to find a simple way to get around this but at the moment I can't. Here's a simple, reproducible example: dat - c(Tue, 15 Nov 2005 09:44:50 EST, 15 Nov 2005 09:10:00 +0100, Tue, 15 Nov 2005 09:44:50 EST, Tue, 15 Nov 2005 16:29:57 +, Wed, 16 Nov 2005 07:00:45 EST, Wed, 16 Nov 2005 05:28:00 -0800, Wed, 16 Nov 2005 14:06:21 +, 15 Nov 2005 09:10:00 +0100) tmp.dat.data - matrix(unlist(strsplit(dat,,)),ncol = 2, byrow = TRUE) tmp.dat.data comes out as a 7x2 matrix contents: [,1] [,2] [1,] Tue 15 Nov 2005 09:44:50 EST [2,] 15 Nov 2005 09:10:00 +0100 Tue [3,] 15 Nov 2005 09:44:50 EST Tue [4,] 15 Nov 2005 16:29:57 + Wed [5,] 16 Nov 2005 07:00:45 EST Wed [6,] 16 Nov 2005 05:28:00 -0800 Wed [7,] 16 Nov 2005 14:06:21 + 15 Nov 2005 09:10:00 +0100 I'd like an 8x2 matrix with tmp.dat.data[2,1] == and tmp.dat.data[8,1] == I'm sure there must be a simple way to achieve this by rolling a slightly different variant of strsplit that pads things and then applying that to the input vector but I'm failing to see how to do this at the moment. TIA, Chris -- Applied researcher, neither statistician nor programmer! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] __ R-help@r-project.org 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] glm fit
Interesting. Now the fifth homework question you have posted here. As was stated before (by several members) this is not a homework forum. Patrick -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of mathallan Sent: Friday, May 08, 2009 5:50 AM To: r-help@r-project.org Subject: [R] glm fit Hi, I try to ask here, because I hope someone will help me understand this problem- I have fittet a glm in R with the results glm1 - glm(log(claims)~log(sum)*as.factor(grp),family=gaussian(link=identity)) summary(glm1) Call: glm(formula = log(claims) ~ log(sum) * as.factor(grp), family = gaussian(link = identity)) Deviance Residuals: Min 1Q Median 3Q Max -6.6836 -1.3626 -0.2576 1.2038 8.2480 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 3.525657 0.436102 8.084 8.18e-16 *** log(sum)0.334288 0.025668 13.024 2e-16 *** as.factor(grp)2 0.434262 0.976240 0.445 0.6565 as.factor(grp)3 3.666490 1.436471 2.552 0.0107 * as.factor(grp)4 0.040782 1.024730 0.040 0.9683 log(sum):as.factor(grp)2 0.007719 0.061914 0.125 0.9008 log(sum):as.factor(grp)3 -0.209986 0.091578 -2.293 0.0219 * log(sum):as.factor(grp)4 0.059342 0.067320 0.881 0.3781 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for gaussian family taken to be 3.693731) Null deviance: 15839 on 4035 degrees of freedom Residual deviance: 14878 on 4028 degrees of freedom AIC: 16737 Number of Fisher Scoring iterations: 2 But i'm not sure what I get out of the summary. What does it tell me? How should the formula for Y look like, out from the summary? Is it something like Y=0.334288*X_sum+0.434262*X_2+ ?? And when I get a expression for Y, what does it tell me? Is it an expected expression? Can anyone help me please? -- View this message in context: http://www.nabble.com/glm-fit-tp23443121p23443121.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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. This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient(s) please contact the sender by reply email and destroy all copies of the original message. Thank you. __ R-help@r-project.org 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] Get (feature, threshold) from Output of rpart() for Stump Tree
--- begin included message -- Hi, I have a question regarding how to get some partial information from the output of rpart, which could be used as the first argument to predict. For example, in my code, I try to learn a stump tree (decision tree of depth 2): fit - rpart(y~bx, weights = w/mean(w), control = cntrl) --- end inclusion --- 1. For stump trees, you can use the depth option in rpart.control to get a small tree. You also might want to set maxsurrogate=0 for speed. 2. Try help(rpart.object) for more information on what is contained in the returned rpart object. In your case fit$splits[1,] would contain all that you need. Terry T. __ R-help@r-project.org 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] Error while using rfImpute
Try re-starting R, load the randomForest package, and then run example(rfImpute) and see if that works. Can you post your sessionInfo() output? Andy From: cosmos science Dear Administrator, I am using linux (suse 10.2). While attempting rfImpute, I am getting the following error message: Members - rfImpute(Status ~ ., data = Members) Error in .C(classRF, x = x, xdim = as.integer(c(p, n)), y = as.integer(y), : C symbol name classRF not in DLL for package randomForest. I need the help to sort out above error. Thanks a lot Regards Mradul [[alternative HTML version deleted]] __ R-help@r-project.org 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. Notice: This e-mail message, together with any attachme...{{dropped:12}} __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! Now see, you made three mistakes here. First, you asked for help cheating with homework on a mailing list filled with lecturers. Second, you offered a pitiful amount to do something that unethical. And thirdly, you violated the rules of the mailing list by not including commented, minimal, self-contained, reproducible code. If you can't even cheat properly, you deserve to fail. Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to dothe assignments for me.
at least he/she is resourceful! (but also very naughty) - Original Message - From: steve_fried...@nps.gov To: ayaku1...@gmail.com Cc: r-help@r-project.org; r-help-boun...@r-project.org Sent: Friday, May 08, 2009 12:48 PM Subject: Re: [R] I'm offering $300 for someone who know R-programming to dothe assignments for me. Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-help@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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@r-project.org 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@r-project.org 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] how to calculace the Observational error of an variable (nls fit)
Hi, ich have a List of measured valuepairs (w, AmpNorm) and a formula f(w, a, b) = AmpNorm i used nls to find the two coefficiants a and b: ctfit.nls - nls(AmpNorm ~ 1/(1 + (w * a - b /w)^2) ...) R ctfit.nls returns Nonlinear regression model model: AmpNorm ~ 1/(1 + (w * a - b /w)^2) data: parent.frame() a b 1.447e-05 9.386e+06 residual sum-of-squares: 0.005164 Number of iterations to convergence: 5 Achieved convergence tolerance: 1.271e-06 Now i want to find out the observational error. So i could write something like a = 1.4e-05 +/- 0.1e-05 or a = 1.4e-05 with 98% confidence Thank you for reading so far and thank you for any help. -- Jonas Stein n...@jonasstein.de __ R-help@r-project.org 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] graph resolution windows (dpi) using x11 device
Dear colleagues, Thank you for the reply. Einer: I tried to so, but I had an error: Error in system(paste(gsexe, -help), intern = TRUE, invisible = TRUE) : gswin32c.exe not found I think would need |ghostscript| (in the help file: You will need |ghostscript|: the full path to the executable can be set by the environment variable R_GSCMD. (If this is unset the setting of GSC is used, otherwise command |gswin32c.exe|, which will work if it is in your PATH.) Uwe: I did so (the figures I sent were like these). The problem is that they want the A and B fig. together mounted, and both of them are so complex (to start with, one is lattice and the other is multi-panel grid plot) that I cannot mount it in R. I don't know how to do it with postcript (mount two figures in the same page, besides I only have acrobat), so I was using GIMP with Tiff... but, there is the resolution problem :-( This is not nice at all... As the journals are becoming more and more noisy about this aspects, it would be excelent to sort this out in R, in an easy way...(developers? :-)) Thank you, All the best, Marta [[alternative HTML version deleted]] __ R-help@r-project.org 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] howto find x value where x=max(x)
Hi, fp is a data frame like this ,[ fp ] |Frequenz AmpNorm | 1 3322 0.0379490639 | 2 3061 0.0476033058 | 3 2833 0.0592954124 | 4 2242 0.1275510204 ` i want to find the Frequenz where AmpNorm is max. I use this line as workaround: PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1] Is there something nicer? And is there an easy way to do the same on predict() Thank you and kind regards, -- Jonas Stein n...@jonasstein.de __ R-help@r-project.org 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] if ((x .2 || x(-.2)) (col(x)!=row(x))) {x=x[, -col(x)]}
You are trying to test the equality of a matrix to a scalar, which will produce a logical vector. You are also using in an apparent attempt to conjoin a complex object which will probably not give you the results you expect in that context either since it would only return a single TRUE or FALSE. Use in situations where you want element-wise comparisons of vectors. You might start by experimenting on a much smaller object and seeing how your efforts at indexing could be improved. X - matrix(c(runif(9)),nrow=3) X [,1] [,2] [,3] [1,] 0.4151688 0.2116687 0.6049845 [2,] 0.7924464 0.6624862 0.8444203 [3,] 0.2634175 0.3357537 0.6923846 X.8 [,1] [,2] [,3] [1,] FALSE FALSE FALSE [2,] FALSE FALSE TRUE [3,] FALSE FALSE FALSE #Use apply to create a logical vector that flags the unwanted rows: apply(X,1,function(x) max(x) 0.8) [1] FALSE TRUE FALSE #Now use that construction on both rows and colums X[-apply(X,1,function(x) max(x) 0.8), -apply(X,2,function(x) max(x) 0.8)] [,1] [,2] [1,] 0.6624862 0.8444203 [2,] 0.3357537 0.6923846 -- David On May 8, 2009, at 1:39 AM, onyourmark wrote: Hi. I have a correlation matrix 'x' which is of size 923x923 I need to remove variables that are highly correlated. I don't have a sophisticated way of selecting which of the two in a highly correlated pair to remove. I thought I would just go through each entry of the correlation matrix and if it is greater than 0.6 (or less than -0.6) I will remove that column and then redo the check from scratch with the matrix (where now the matrix has one less column). As a test, I tried if ((x .2 || x(-.2)) col(x)!=row(x)) {x=x[,- col(x)]} but it does not remove any columns. Also, I realized that I actually need to pull out the row that is associated with that variable as well, and so perhaps the section inside {} needs to be something like: {x=x[-col(x),-col(x)] Any idea on how to do this? Thank you. -- View this message in context: http://www.nabble.com/if-%28%28x-%3E.2-%7C%7C-x%3C%28-.2%29%29%28col%28x%29%21%3Drow%28x%29%29%29-%7Bx%3Dx-%2C-col%28x%29-%7D-tp23440419p23440419.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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. David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org 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] Get (feature, threshold) from Output of rpart() for Stump Tree
Thank you so much! It seems that fit$splits[1,] does not contain the feature ID: fit$splits[1,] count ncat improve index adj 124.000 -1.000 0.3437644 13.500 0.000 However help(rpart.object) says: splits: a matrix describing the splits. The row label is the name of the split variable,... I try to get the row label of fit$splits[1,] by names(fit$splits[1,]) [1] count ncat improve index adj However it has no feature ID. Is this the correct way to get the row label of fit$splits[1,]? Regards, - Tim --- On Fri, 5/8/09, Terry Therneau thern...@mayo.edu wrote: From: Terry Therneau thern...@mayo.edu Subject: Re: Get (feature, threshold) from Output of rpart() for Stump Tree To: Tim timlee...@yahoo.com Cc: r-help@r-project.org Date: Friday, May 8, 2009, 8:05 AM --- begin included message -- Hi, I have a question regarding how to get some partial information from the output of rpart, which could be used as the first argument to predict. For example, in my code, I try to learn a stump tree (decision tree of depth 2): fit - rpart(y~bx, weights = w/mean(w), control = cntrl) --- end inclusion --- 1. For stump trees, you can use the depth option in rpart.control to get a small tree. You also might want to set maxsurrogate=0 for speed. 2. Try help(rpart.object) for more information on what is contained in the returned rpart object. In your case fit$splits[1,] would contain all that you need. Terry T. [[alternative HTML version deleted]] __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
The venom from everyone is to be expected here ayaku. While scientific listservs are a bad place to ask for people to do your homework, they are great for getting advice and soliciting tutors. R is a great program and a lot of fun to learn. Why not put your money to better use and hire a local tutor to help you learn something you can use for many things and many years to come? On Fri, May 8, 2009 at 12:19 AM, ayaku1...@gmail.com ayaku1...@gmail.com wrote: There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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@r-project.org 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] howto find x value where x=max(x)
try this: with(fp, Frequenz[which.max(AmpNorm)]) baptiste On 8 May 2009, at 14:49, Jonas Stein wrote: Hi, fp is a data frame like this ,[ fp ] |Frequenz AmpNorm | 1 3322 0.0379490639 | 2 3061 0.0476033058 | 3 2833 0.0592954124 | 4 2242 0.1275510204 ` i want to find the Frequenz where AmpNorm is max. I use this line as workaround: PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1] Is there something nicer? And is there an easy way to do the same on predict() Thank you and kind regards, -- Jonas Stein n...@jonasstein.de __ R-help@r-project.org 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. _ Baptiste Auguié School of Physics University of Exeter Stocker Road, Exeter, Devon, EX4 4QL, UK Phone: +44 1392 264187 http://newton.ex.ac.uk/research/emag __ R-help@r-project.org 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] howto find x value where x=max(x)
Hi, you could use which.max(). fp$Frequenz[which.max(fp$AmpNorm)] I found the reference in the max() help. Lasse Am Freitag, den 08.05.2009, 14:49 +0200 schrieb Jonas Stein: Hi, fp is a data frame like this ,[ fp ] |Frequenz AmpNorm | 1 3322 0.0379490639 | 2 3061 0.0476033058 | 3 2833 0.0592954124 | 4 2242 0.1275510204 ` i want to find the Frequenz where AmpNorm is max. I use this line as workaround: PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1] Is there something nicer? And is there an easy way to do the same on predict() Thank you and kind regards, -- Lasse Bombien Institut für Phonetik und Sprachverarbeitung Schellingstraße 3/II D-80799 München email: la...@phonetik.uni-muenchen.de web: http://www.phonetik.uni-muenchen.de/~lasse phone: +49 (0) 89 2180 2812 __ R-help@r-project.org 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] howto find x value where x=max(x)
fp is a data frame like this ,[ fp ] |Frequenz AmpNorm | 1 3322 0.0379490639 | 2 3061 0.0476033058 | 3 2833 0.0592954124 | 4 2242 0.1275510204 ` i want to find the Frequenz where AmpNorm is max. Use which.max. fp - data.frame(Freqenz=c(3322,3061,2833,2242), AmpNorm=c(0.0379,0.0476,0.0592,0.1276)) index.of.max - which.max(fp$AmpNorm) fp$Freqenz[index.of.max] Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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] graph resolution windows (dpi) using x11 device
On Fri, May 08, 2009 at 01:45:22PM +0100, Marta M. Rufino wrote: Error in system(paste(gsexe, -help), intern = TRUE, invisible = TRUE) : gswin32c.exe not found I think would need |ghostscript| (in the help file: You will need |ghostscript|: the full path to the executable can be set by the environment variable R_GSCMD. (If this is unset the setting of GSC is used, otherwise command |gswin32c.exe|, which will work if it is in your PATH.) So downloading and installing ghostscript should fix that: http://www.ghostscript.com The problem is that they want the A and B fig. together mounted, and both of them are so complex (to start with, one is lattice and the other is multi-panel grid plot) that I cannot mount it in R. I don't know how to do it with postcript (mount two figures in the same page, besides I only have acrobat), so I was using GIMP with Tiff... but, there is the resolution problem :-( I would avoid using TIFF for self-created graphs and illustrations, anyway. Adobe Illustrator or Corel Draw should be able to handle that. On my Linux system I'd use xfig for that task and there seems to be a Windows port: http://www.schmidt-web-berlin.de/winfig/ Inkscape should also work: http://www.inkscape.org Another free alternative would be OpenOffice Draw which should be able to import eps graphics and is definitly capable of producing pdf output. cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan 85350 Freising, Germany http://mips.gsf.de/staff/pagel __ R-help@r-project.org 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] Using lme() for split plot
Thanks for the tip. That lead me to find this paper: http://www.ualberta.ca/~baayen/publications/baayenDavidsonBates.pdf which looks like it will answer my problem. Depending on how we actually decide to execute the test it might turn out to be nested like those other examples, but it's nice to have options. Thanks again. On Thu, May 7, 2009 at 6:13 PM, Bert Gunter gunter.ber...@gene.com wrote: Crossed Random effects are difficult using lme (wasn't designed for it). Try lmer in the lme4 package if you need this. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Joshua Stults Sent: Thursday, May 07, 2009 3:02 PM To: Rubén Roa-Ureta; r-help@r-project.org Subject: Re: [R] Using lme() for split plot That's a good example with a couple levels of nesting (similar to the examples in the other book), but they still only have one factor, 'Variety', nested in each block. Am I missing something? Should I make up a psuedofactor with four levels to code my two two-level factors? On Thu, May 7, 2009 at 5:46 PM, Rubén Roa-Ureta r...@udec.cl wrote: Joshua Stults wrote: Hi, I'm trying to figure out how to use lme() for analyzing a split-plot experiment. I've been looking at the examples from the 'R Book', those are nested but with only one factor at the whole-plot level, my test is 2^2 at the whole-plot level, with a single many level factor at the sub-plot level. My question is about properly specifying the random effects part of the model, lme( y ~ block + a*b*poly(c, n), random=~ ? ) Where 'a' and 'b' are my two level whole-plot factors and 'c' is the many level sub-plot factor. I'm not sure what to use to get the right error terms. Do I use two error terms: random = ~ 1 | block/a + 1 | block/b or one: random = ~ 1 | block/a*b or something else entirely? I haven't been able to find any relevant examples on Google. Thanks for any suggestions/pointers. Have you checked Pinheiro and Bates 2004 Mixed-effects models in S and S-PLUS? They have a split-plot example starting on p. 45. Rubén -- Joshua Stults Website: http://j-stults.blogspot.com __ R-help@r-project.org 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. -- Joshua Stults Website: http://j-stults.blogspot.com __ R-help@r-project.org 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] howto find x value where x=max(x)
Dear Jonas, Try this: with(fp, Frequenz[ which.max(AmpNorm) ] ) HTH, Jorge On Fri, May 8, 2009 at 8:49 AM, Jonas Stein n...@jonasstein.de wrote: Hi, fp is a data frame like this ,[ fp ] |Frequenz AmpNorm | 1 3322 0.0379490639 | 2 3061 0.0476033058 | 3 2833 0.0592954124 | 4 2242 0.1275510204 ` i want to find the Frequenz where AmpNorm is max. I use this line as workaround: PeakFreqHz = subset(fp, AmpNorm == max(AmpNorm))$Frequenz[1] Is there something nicer? And is there an easy way to do the same on predict() Thank you and kind regards, -- Jonas Stein n...@jonasstein.de __ R-help@r-project.org 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. [[alternative HTML version deleted]] __ R-help@r-project.org 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] Gantt chart but slightly different
Hello, I am new to this list and rather new to graphics with R. I would like to make a chart like Gantt chart, something like that: require (plotrix) Ymd.format-%Y/%m/%d gantt.info-list(labels=c(Male 1,Male 1,Male 1, Male 2, Male 2), starts=as.POSIXct(strptime(c(2004/01/01,2004/04/03,2004/05/06, 2004/03/05, 2004/05/20),format=Ymd.format)), ends=as.POSIXct(strptime(c(2004/03/03,2004/04/20, 2004/05/29, 2004/05/06, 2004/06/10), format=Ymd.format)), priorities=c(1,2)) vgridpos-as.POSIXct(strptime(c(2004/01/01,2004/02/01,2004/03/01, 2004/04/01,2004/05/01,2004/06/01,2004/07/01,2004/08/01, 2004/09/01,2004/10/01,2004/11/01,2004/12/01),format=Ymd.format)) vgridlab-c(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec) gantt.chart(gantt.info,main=, priority.legend=FALSE,vgridpos=vgridpos,vgridlab=vgridlab,hgrid=FALSE, taskcolors=NULL, cylindrical=FALSE) but I would like to fill the different blocks of tasks with different pattern i.e. first blocks of Male 1 and Male 2 with pattern 1, second blocks of Male 1 and Male 2 with pattern 2 etc. Any idea? Bests, Beata __ R-help@r-project.org 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] Plotting questions (ROCR)
Thanks! I am now also trying to plot several ROCs in the same figure using ROCR package. The following code: pred1 - prediction(yest1,ytest) perf1 - performance( pred1, tpr, fpr ) plot( perf1 ) pred2 - prediction(yest2,ytest) perf2 - performance( pred2, tpr, fpr ) lines( perf2 ) will result in error at lines( perf2 ): Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' Is there any way to solve it? Regards, Richard Cotton wrote: 1. How to plot several lines in a figure? Suppose I have several sets of points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1) will give a line connecting these points. Another plot(x2,y2) will erase what plot before and plot the new line. Can I have these lines all drawn in the same figure? #Draw your plot plot(seq(0,1,length.out=20)) #Add lines to the existing plot lines(runif(20)) #Add points to the existing plot points(runif(20), col=red) 2. How to open another figure window? Repeating plot will redraw in the same window instead of opening another one. On Windows, windows() will open a new figure window; quartz() on Mac OSX and x11() on Linux do the same. Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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. - Regards, Richie. Mathematical Sciences Unit HSL -- View this message in context: http://www.nabble.com/Plotting-questions-tp23442445p23446000.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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] RSPerl and Statistics::R
Taking a quick gander at RServe — interesting. I think that some of the magic RSPerl is doing in munging R data types into Perl constructs is the tricky part of the exercise. While I like the close binding to R itself that RSPerl uses, going through an intermediary like RServe might prove easier in that regard. At least, given the java examples, the casts of the data values are more explicit. It's worth considering; the protocol doesn't look terribly onerous. Thinking about it... just for giggles... RServe could probably facilitate a user-space filesystem representation of an R environment via the FUSE (or MacFUSE) projects. Not that it would useful, but I'm sure there's a student project in it somewhere :) Cheers, DMK Stefan Evert stefan.ev...@uos.de 07/05/2009 7:27 pm With all the problems that RSPerl has -- and they're mostly related to using R from Perl AFAIK -- I'm wondering if it wouldn't make for people like us to develop a Perl client for the Rserve protocol (see http://www.rforge.net/Rserve/) . Best, Stefan Evert [ stefan.ev...@uos.de | http://purl.org/stefan.evert ] This email (including attachments and files, if any) is confidential, may be privileged and is intended for the above-named recipient(s) only. If you have received this message in error, please notify me by return email and delete this message from your system. Any unauthorized use or disclosure of this message is strictly prohibited. Copyright in this email and any document created by Genesis Genomics will be and remain vested in us and will not be transferred to you. __ R-help@r-project.org 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] problem with normalize.quantiles
again, the bioconductor list is appropriate. You'll want to be sure to update your packages using the instructions at http://bioconductor.org/docs/install/ and be sure to provide the output of sessionInfo() to make any actual problems easier to track down. Martin George Chen glc...@stanford.edu writes: Hi All, I am using normalize.quantiles (package preprocessCore) to process a 8300 row x 96 col matrix, all numerical data. When I limit the input matrix to 8300 x 67, the function works fine and my data is normalized. But when I increase the input matrix size to 8300 x 68, the function processes but instead of giving normalized data, it gives me all the same number. With 96 columns (the whole matrix), much the same happens. Has anyone had any experience with this and what to do about it. I would really like to not have to prune my dataset. Examples: Limited input matrix (col = 67) [,1] [,2] [,3] [,4] [,5] [1,] NA 5977.433 .572 6826.831 4142.117 [2,] 3012.837 6617.005 6036.862 7796.186 5453.295 [3,] NA 5977.433 7192.046 7582.068 6042.775 [4,] 1780.039 1732.662 6373.366 7825.302 6775.492 [5,] NA 3308.601 2297.677 7294.935 1482.699 [6,] NA 3569.632 3509.979 3566.683 NA [7,] NA 4492.529 6399.490 4925.750 1921.428 [8,] NA 2416.358 3958.061 4592.030 2829.436 [9,] 7889.050 7928.198 7929.257 7930.121 7927.907 [10,] 7542.413 7893.827 7889.407 7896.078 7894.852 78 col input matrix [,1] [,2] [,3] [,4] [,5] [1,] NA 7883.356 7883.356 7883.356 7883.356 [2,] 7883.356 7883.356 7883.356 7883.356 7883.356 [3,] NA 7883.356 7883.356 7883.356 7883.356 [4,] 7883.356 7883.356 7883.356 7883.356 7883.356 [5,] NA 7883.356 7883.356 7883.356 7883.356 [6,] NA 7883.356 7883.356 7883.356 NA [7,] NA 7883.356 7883.356 7883.356 7883.356 [8,] NA 7883.356 7883.356 7883.356 7883.356 [9,] 7883.356 7883.356 7883.356 7883.356 7883.356 [10,] 7883.356 7883.356 7883.356 7883.356 7883.356 whole input matrix (96 col) [,1] [,2] [,3] [,4] [,5] [1,] NA 7747.377 7747.377 7747.377 7747.377 [2,] 7747.377 7747.377 7747.377 7747.377 7747.377 [3,] NA 7747.377 7747.377 7747.377 7747.377 [4,] 7747.377 7747.377 7747.377 7747.377 7747.377 [5,] NA 7747.377 7747.377 7747.377 7747.377 [6,] NA 7747.377 7747.377 7747.377 NA [7,] NA 7747.377 7747.377 7747.377 7747.377 [8,] NA 7747.377 7747.377 7747.377 7747.377 [9,] 7747.377 7747.377 7747.377 7747.377 7747.377 [10,] 7747.377 7747.377 7747.377 7747.377 7747.377 Thanks in advance, George __ R-help@r-project.org 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. -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 __ R-help@r-project.org 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] making an Affybatch object for expresso
George Chen glc...@stanford.edu writes: Hi All, I have microarray data that does not come in a CEL file. Currently it is in the form of columns = individual samples and rows = individual probes. There are about 79 columns and it is in a tab delimited text file. Is there a way to convert this file into an AffyBatch so that I can run expresso with it? Ask on the Bioconductor mailing list http://bioconductor.org/docs/mailList.html or better search in the archive (from the same location) during the last two months to see answers to similar questions. Martin Thanks, George __ R-help@r-project.org 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. -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 __ R-help@r-project.org 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] postscript()-resolution
Dear users, another question concerning graphics for publications. My favourite journal wants .eps-graphics, and from older postings i adapted the following code: postscript(file=Figure1.eps, title=Figure 1, width=11.5, height=8, paper=a4,onefile=FALSE) However, when checking the properties of this file, it is a .ps and not a .eps file. So, i konverted to .eps with ghostview. Then, for windows it is no longer a file of type postscript, but just a file of type file, what makes me nervous. Any clue how to produce .eps-files in a more convenient way? In addition, the journal says that the files should be at 600 dpi resolution. Since there is no resolution-argument to postscript(), how can i check/ensure, that the resolution i high enough? Thanks for your help, Henning -- [[alternative HTML version deleted]] __ R-help@r-project.org 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] ADAPTIVE QUADRATURE WEIGHTS AND NODES
Can anyone help me on how to get the nodes and weights of the adaptive quadrature using R. Best wishes Boikanyo. - The University of Glasgow, charity number SC004401 __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
well..why shame? He doesn't say it's a homework really. On May 8, 4:48 am, steve_fried...@nps.gov wrote: Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-h...@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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] expression(paste with the superscript in bold font
Hi, I`m trying to put my superscript type in bold style. Could somebody help me? My text is inside a barplot. #!/bin/Rbarplot(x, ylab=expression(paste(org., cm^-2))) # so I tried this way, *barplot(x, ylab=expression(bold(paste(org., cm^-2* # but my superscript maintain its shape in regular font type. Thank you all. [[alternative HTML version deleted]] __ R-help@r-project.org 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] sscanf
Dear list, Apparently, there is no function like sscanf in R. I have a string, Condition: 311, and I would like to read out the number and store it to a numeric variable. Is there an easy way to do this? Best wishes, Matthias -- __ R-help@r-project.org 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] Plotting questions (ROCR)
To have several performance curves on a single plot, use the add=TRUE option, e.g. as follows: plot(perf1) plot(perf2, add=TRUE, col='red') Please read the help to ?plot.performance. It also tells you how you can adjust all graphical parameters for the individual curves. This slide deck contains several examples that might help you: http://rocr.bioinf.mpi-sb.mpg.de/ROCR_Talk_Tobias_Sing.ppt HTH, Tobias On Fri, May 8, 2009 at 3:28 PM, lehe timlee...@yahoo.com wrote: Thanks! I am now also trying to plot several ROCs in the same figure using ROCR package. The following code: pred1 - prediction(yest1,ytest) perf1 - performance( pred1, tpr, fpr ) plot( perf1 ) pred2 - prediction(yest2,ytest) perf2 - performance( pred2, tpr, fpr ) lines( perf2 ) will result in error at lines( perf2 ): Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' Is there any way to solve it? Regards, Richard Cotton wrote: 1. How to plot several lines in a figure? Suppose I have several sets of points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1) will give a line connecting these points. Another plot(x2,y2) will erase what plot before and plot the new line. Can I have these lines all drawn in the same figure? #Draw your plot plot(seq(0,1,length.out=20)) #Add lines to the existing plot lines(runif(20)) #Add points to the existing plot points(runif(20), col=red) 2. How to open another figure window? Repeating plot will redraw in the same window instead of opening another one. On Windows, windows() will open a new figure window; quartz() on Mac OSX and x11() on Linux do the same. Regards, Richie. Mathematical Sciences Unit HSL ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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. - Regards, Richie. Mathematical Sciences Unit HSL -- View this message in context: http://www.nabble.com/Plotting-questions-tp23442445p23446000.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
Tung86 wrote: well..why shame? He doesn't say it's a homework really. indeed; while it might of course have been a serious offer, i can't get rid of the feeling that what we see could also be a deliberate -- and quite successful -- provocation, and that the author might be now having lots of fun reading all that preaching... vQ On May 8, 4:48 am, steve_fried...@nps.gov wrote: Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-h...@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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. -- --- Wacek Kusnierczyk, MD PhD Email: w...@idi.ntnu.no Phone: +47 73591875, +47 72574609 Department of Computer and Information Science (IDI) Faculty of Information Technology, Mathematics and Electrical Engineering (IME) Norwegian University of Science and Technology (NTNU) Sem Saelands vei 7, 7491 Trondheim, Norway Room itv303 Bioinformatics Gene Regulation Group Department of Cancer Research and Molecular Medicine (IKM) Faculty of Medicine (DMF) Norwegian University of Science and Technology (NTNU) Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway Room 231.05.060 __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
I bet at least a few people offered their services! It might be an undercover sting operation to weed out the unethical amongst us :-) - Original Message - From: Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no To: Tung86 wyut...@gmail.com Cc: R help r-h...@stat.math.ethz.ch Sent: Friday, May 08, 2009 3:18 PM Subject: Re: [R] I'm offering $300 for someone who know R-programming to do the assignments for me. Tung86 wrote: well..why shame? He doesn't say it's a homework really. indeed; while it might of course have been a serious offer, i can't get rid of the feeling that what we see could also be a deliberate -- and quite successful -- provocation, and that the author might be now having lots of fun reading all that preaching... vQ On May 8, 4:48 am, steve_fried...@nps.gov wrote: Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-h...@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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. -- --- Wacek Kusnierczyk, MD PhD Email: w...@idi.ntnu.no Phone: +47 73591875, +47 72574609 Department of Computer and Information Science (IDI) Faculty of Information Technology, Mathematics and Electrical Engineering (IME) Norwegian University of Science and Technology (NTNU) Sem Saelands vei 7, 7491 Trondheim, Norway Room itv303 Bioinformatics Gene Regulation Group Department of Cancer Research and Molecular Medicine (IKM) Faculty of Medicine (DMF) Norwegian University of Science and Technology (NTNU) Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway Room 231.05.060 __ R-help@r-project.org 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@r-project.org 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] postscript()-resolution
Hi Henning, maybe you just lost the extension (.eps) of the file when converting it with ghostview. But R postscript(..,onefile=FALSE) produces actually an eps compatible file. An (encapsulated) postscript file is a vector based file format, so there isn't such a thing as a resulution, since it can be arbitrarily rescaled (and a printed version depends on the possible ps-printer dpi.) When converting it (eg with ghostscript) to a bitmap based filetype, such as tiff, you can specify a resulution. Hth. Henning Wildhagen schrieb: Dear users, another question concerning graphics for publications. My favourite journal wants .eps-graphics, and from older postings i adapted the following code: postscript(file=Figure1.eps, title=Figure 1, width=11.5, height=8, paper=a4,onefile=FALSE) However, when checking the properties of this file, it is a .ps and not a .eps file. So, i konverted to .eps with ghostview. Then, for windows it is no longer a file of type postscript, but just a file of type file, what makes me nervous. Any clue how to produce .eps-files in a more convenient way? In addition, the journal says that the files should be at 600 dpi resolution. Since there is no resolution-argument to postscript(), how can i check/ensure, that the resolution i high enough? Thanks for your help, Henning __ R-help@r-project.org 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@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
Wacek raises a very valid perspective. I have previously not responded to these requests, and I've seen a bunch. I have thought they were a waste of my time to respond to. In the future I think I'll simpy disregard these requests, because I simply can not crystal ball the true needs of the originator. Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 Wacek Kusnierczyk Waclaw.Marcin.Ku snierc...@idi.ntn To u.no Tung86 wyut...@gmail.com Sent by: cc r-help-boun...@r- R help r-h...@stat.math.ethz.ch project.org Subject Re: [R] I'm offering $300 for someone who know R-programming to 05/08/2009 04:18 do the assignments for me. PM ZE2 Tung86 wrote: well..why shame? He doesn't say it's a homework really. indeed; while it might of course have been a serious offer, i can't get rid of the feeling that what we see could also be a deliberate -- and quite successful -- provocation, and that the author might be now having lots of fun reading all that preaching... vQ On May 8, 4:48 am, steve_fried...@nps.gov wrote: Shame on you! Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147 ayaku1...@gmail. com ayaku1...@gmail. To com r-h...@r-project.org Sent by: cc r-help-boun...@r- project.org Subject [R] I'm offering $300 for someone who know R-programming to do the 05/07/2009 09:19 assignments for me. PM MST There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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. -- --- Wacek Kusnierczyk, MD PhD Email: w...@idi.ntnu.no Phone: +47 73591875, +47 72574609 Department of Computer and Information Science (IDI) Faculty of Information Technology, Mathematics and Electrical Engineering (IME) Norwegian University of Science and Technology (NTNU) Sem Saelands vei 7, 7491 Trondheim, Norway Room itv303 Bioinformatics Gene Regulation Group Department of Cancer Research and Molecular Medicine (IKM) Faculty of Medicine (DMF) Norwegian University of Science and Technology (NTNU) Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway Room 231.05.060 __ R-help@r-project.org 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] display data ( text) on leveplot / Superpose panel
I would have expected that Sarkar's response to a similar question about dotplot offered yesterday ought to have a good chance of answering this question. Search on dotplot: labeling coordinates for each point -- David Winsemius On May 8, 2009, at 1:13 AM, kulwinder banipal wrote: I am trying to display data ion top of colored rectangle on the same levelplot. While using superpose the shape and symbol for levelplot changes to small circle. I am unable to figure what exactly I am doing wrong... It may be straightforward solution... .I will appreciate help to fix this issue. brewer.div- colorRampPalette(c(pink,green,blue,yellow,red), interpolate=linear)levelplot(ds, shrink=c(0.9,1), aspect=3/5, scales=list(x=list(rot=0)), cuts = 10, col.regions = brewer.div(20), xlab=, ylab= , main= , panel = function(x,y,z,...) { panel.superpose(x,y,z,...) ltext(x,y,paste(z), adj=c(0,2), cex=.8, col='black')} ) where ds is matrix pct20 pct40 pct60 pct80 pct100A1618 6 2 0C 1911 7 0 0D 916 2 0 0E 135 9 0 0 0J9057 3 1 0M 4717 1 0 0T19 9 3 1 0 That is not a usable example. Next time use plain text rather than HTML mail format. ThanksKulwinder Banipal _ Hotmail® goes with you. ial_Mobile1_052009 [[alternative HTML version deleted]] David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org 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] postscript()-resolution
On Fri, 2009-05-08 at 15:47 +0200, Henning Wildhagen wrote: Dear users, another question concerning graphics for publications. My favourite journal wants .eps-graphics, and from older postings i adapted the following code: postscript(file=Figure1.eps, title=Figure 1, width=11.5, height=8, paper=a4,onefile=FALSE) I think you need 'paper = special' to get an eps file - the hight and width set the size of the plot, so you don't need to say what paper it is on for eps. HTH G However, when checking the properties of this file, it is a .ps and not a .eps file. So, i konverted to .eps with ghostview. Then, for windows it is no longer a file of type postscript, but just a file of type file, what makes me nervous. Any clue how to produce .eps-files in a more convenient way? In addition, the journal says that the files should be at 600 dpi resolution. Since there is no resolution-argument to postscript(), how can i check/ensure, that the resolution i high enough? Thanks for your help, Henning __ R-help@r-project.org 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. -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% signature.asc Description: This is a digitally signed message part __ R-help@r-project.org 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] by-group processing
On Thursday, May 07, 2009 7:45 PM, David Freedman wrote: ...how about: d=data[order(data$ID,-data$Type),] d[!duplicated(d$ID),] Does the -data$Type argument to the order function work? -- David - David Huffer, Ph.D. Senior Statistician CSOSA/Washington, DC david.huf...@csosa.gov __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
On Fri, May 8, 2009 at 12:19 AM, ayaku1...@gmail.com ayaku1...@gmail.com wrote: There are six assignments in total. It won't take you long if you were familiar with R. For those who are interested, please send me an email with your profile (your experience with R, how long and how often have you been using it.) I will be paying through paypal. Thanks! __ R-help@r-project.org 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. And the crazy thing is that if he went to Amazon and ordered 2 R books with one-day shipping, he could do it himself and probably spend half as much. -- Due to the recession, requests for instant gratification will be deferred until arrears in scheduled gratification have been satisfied. __ R-help@r-project.org 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] sscanf
You can always use regular expressions: x - Condition: 311 as.integer(sub(.*?(\\d file://d/+).*, \\1 file://0.0.0.1/, x, perl=TRUE)) [1] 311 On Fri, May 8, 2009 at 10:16 AM, Matthias Gondan matthias-gon...@gmx.dewrote: Dear list, Apparently, there is no function like sscanf in R. I have a string, Condition: 311, and I would like to read out the number and store it to a numeric variable. Is there an easy way to do this? Best wishes, Matthias -- __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htmlhttp://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? [[alternative HTML version deleted]] __ R-help@r-project.org 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] RGoogleDocs
Hi there, I'm not certain if this is the correct list where to post this question, or if it ought to be on the R developper one... I am trying to use the RGoogleDocs package to import into R the spreadsheets on my Google docs account. I downloaded the latest package (0.2.0) and installed it. I can get a connection going, but it seems that I can only get a doc one... Here is the code I am using: library(RGoogleDocs) auth = getGoogleAuth(loginName, psswrd, service=wise) sheets.con = getGoogleDocsConnection(auth) a - getDocs(sheets.con) I get the following error: Error in checkSlotAssignment(object, name, value) : assignment of an object of class NULL is not valid for slot access in an object of class GoogleSpreadsheet; is(value, character) is not TRUE If i change the service to writely, I get the full listing of the google docs and cannot import a spreadsheet due to the fact that the sheets.con is of the wrong class. Any help would be appreciated ! I am running under Ubunto 8.10 if that can help... Thanks. Robert _ [[alternative HTML version deleted]] __ R-help@r-project.org 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] Plotting questions
lehe timlee...@yahoo.com 08/05/2009 09:58:40 1. How to plot several lines in a figure? See ?lines 2. How to open another figure window? see ?windows *** This email and any attachments are confidential. Any use...{{dropped:8}} __ R-help@r-project.org 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] 'Dynamic' 3D plot
Hi Tony, Am Freitag, den 08.05.2009, 14:06 +0100 schrieb Tony Breyal: Hi mate, i think you mistakenly emailed this message only to me rather than the whole list. Tony. Thank you for forwarding my mail to the list. I post to seldom to r-help. And I am used from other mailing list simply to reply the postings. Regards Juergen 2009/5/8 Juergen Rose r...@rz.uni-potsdam.de Am Freitag, den 08.05.2009, 02:43 -0700 schrieb Tony Breyal: Hi Martial, The rgl package is quite nice for this sort of thing: # this is the example in ?plot3d library(rgl) open3d() x - sort(rnorm(1000)) y - rnorm(1000) z - rnorm(1000) + atan2(x,y) plot3d(x, y, z, col=rainbow(1000)) Did somebody try to move the view of the resulting picture and record this movement with gtk-recordMyDesktop? If I try this, I see in the resulting ogv file the movement of the cursor but not the movement of the coordinate axis. Only at the end the picture jumps to the final position. HTH, Tony Breyal .. On 8 May, 09:25, Martial Sankar martial100...@hotmail.com wrote: Hi, I am looking for a R package to draw 3d plot. But not in a static way like scatterplot3d or stuff like that. I would like to make rotate the plot, to zoom/unzoom etc..., actually to render the graph 'dynamic'... (for the biologist and bioinformatician, a R package which permitts to reproduce what pdb viewer does). Does a Way exist to do something like that in R ? Thanks, _ Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! [[alternative HTML version deleted]] __ r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org 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. -- Juergen Rose r...@rz.uni-potsdam.de Uni Potsdam -- Juergen Rose r...@rz.uni-potsdam.de Uni Potsdam __ R-help@r-project.org 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] centering axis labels in lattice
Hello, I'm attempting to alter the location of text in my axis labels in lattice plots and have been unsuccessful so far. For example, the y-axis labels are always right-justified, but I would like them to be horizontally centered. Here's an example: library(lattice); # create fake dataset to plot to.plot - data.frame( x = 1:5, y = c(1\nAAA, 2\nBBB, 3\nCCC, 4\nDDD, 5\nEEE) ); # initial plot, note that the y-axis labels are right-justified xyplot( y ~ x, to.plot, pch = 19, ylab = , xlab = , cex = 3 ); # now try to set the positioning via scales xyplot( y ~ x, to.plot, pch = 19, ylab = , xlab = , cex = 3, scales = list( labels = to.plot$y, hjust = 0.5, vjust = 0.5 ) ); I also explored using yscale.components.default(), but specifying hjust and vjust there did not help. Any suggestions would be very much appreciated! Paul sessionInfo(); R version 2.8.1 (2008-12-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods base other attached packages: [1] lattice_0.17-22 __ R-help@r-project.org 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] Linear least squares fit with errors in both x and y values.
Found an answer here, don't know if anyone's implemented it for R though. www.iop.org/EJ/article/0022-3735/22/4/002/jev22i4p215.pdf James Gerard M. Keogh wrote: James, look up errors in variables models or instrumental variable models in econometrics. The statistics alternative is a random effects or mixed effects model which plugs the variation in the x's into a randomly varying parameter - these are available in R (?lmer or glmm - I think). Someone on the list much more knowledgeable than I about these will be able to give you some help if you ask a good question. Gerard James Allsopp jamesaalls...@go oglemail.com To Sent by: r-help@r-project.org r-help-boun...@r- cc project.org Subject [R] Linear least squares fit with 07/05/2009 15:19 errors in both x and y values. HI, I'd like to perform a weighted linear least squares fit with R on data with varying errors on both vectors. I can do this with one axis using lm, but have no idea where to go from here. I've tried googling, but no idea. Any suggestions? Thanks, James __ R-help@r-project.org 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. ** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. It is the policy of the Department of Justice, Equality and Law Reform and the Agencies and Offices using its IT services to disallow the sending of offensive material. Should you consider that the material contained in this message is offensive you should contact the sender immediately and also mailminder[at]justice.ie. Is le haghaidh an duine nó an eintitis ar a bhfuil sí dírithe, agus le haghaidh an duine nó an eintitis sin amháin, a bheartaítear an fhaisnéis a tarchuireadh agus féadfaidh sé go bhfuil ábhar faoi rún agus/nó faoi phribhléid inti. Toirmisctear aon athbhreithniú, atarchur nó leathadh a dhéanamh ar an bhfaisnéis seo, aon úsáid eile a bhaint aisti nó aon ghníomh a dhéanamh ar a hiontaoibh, ag daoine nó ag eintitis seachas an faighteoir beartaithe. Má fuair tú é seo trí dhearmad, téigh i dteagmháil leis an seoltóir, le do thoil, agus scrios an t-ábhar as aon ríomhaire. Is é beartas na Roinne Dlí agus Cirt, Comhionannais agus Athchóirithe Dlí, agus na nOifígí agus na nGníomhaireachtaí a úsáideann seirbhísí TF na Roinne, seoladh ábhair cholúil a dhícheadú. Más rud é go measann tú gur ábhar colúil atá san ábhar atá sa teachtaireacht seo is ceart duit dul i dteagmháil leis an seoltóir láithreach agus le mailminder[ag]justice.ie chomh maith. *** __ R-help@r-project.org 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] partial mantel tests Ecodist
Hi all, I'm searching for a little clarification on partial mantel tests (ecodist package) I've a distance matrix (x,y), and several others containing environmental/chemical variables. Based on the help file, and the package instructions I've managed to implement the tests as; var1 ~ env1 + space to partial out the effect of space and test the relationship between the variable of interest vs variable env1. My questions are as follows; 1) can raw data be used to construct the dissimilarity matricies? or should they be standardized? different variables have different measurment scales, my inclination is to standardize, but I don't know if this will dampen relationships between variables. 2) If env1 and another variable are correlated, is the appropriate test var1 ~ env1 + env2 + space?, or var1 ~ env1 + space and then var1 ~ env2 + space? 3) interpretation... Does the value of r (i.e. + or -) imply spatial overlap (+) or spatial exclusion (-)? Any assistance would be greatly appreciated! Thanks, -- David Depew PhD Candidate Department of Biology University of Waterloo 200 University Ave W Waterloo, Ontario, Canada N2L 3G1 T:(1)-519-888-4567 x 33895 F:(1)-519-746-0614 dde...@scimail.uwaterloo.ca http://www.science.uwaterloo.ca/~ddepew __ R-help@r-project.org 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] plotting with gap in x-axis range
Hi, I need to make a plot of data from multiple epochs, and so I'd need to introduce a couple of breaks in the x-axis not to have too many empty space in my plot. I discovered a function in the package plotrix which makes breaks in axis, but it is not what I was actually looking for, because it doesn't really introduce the a range gap or rescale the plot according to the suppressed spaces. does anyone know of a function (or a procedure) that would do that for me? thanks and best regards, Ulisses. Ulisses Barres de Almeida, M.Sc. CAPES Ph.D. - Astrophysics The H.E.S.S. Collaboration University of Durham, England Time past and time future What might have been and what has been Point to one end, which is always present. T.S.Eliot - Burnt Norton, Four Quartets [[alternative HTML version deleted]] __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
On Fri, May 8, 2009 at 4:06 PM, Mitchell Maltenfort mmal...@gmail.com wrote: And the crazy thing is that if he went to Amazon and ordered 2 R books with one-day shipping, he could do it himself and probably spend half as much. And the crazier thing is that if homework cheats lurked moar then they could probably rewrite their examples so they didn't look like homework and get them done for free by asking nicely here. I might offer $100 and if it looks like homework just get them all wrong. Barry __ R-help@r-project.org 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] partial mantel tests Ecodist
Hi David, On Fri, May 8, 2009 at 10:27 AM, dde...@sciborg.uwaterloo.ca wrote: My questions are as follows; 1) can raw data be used to construct the dissimilarity matricies? or should they be standardized? different variables have different measurment scales, my inclination is to standardize, but I don't know if this will dampen relationships between variables. I'd standardize, especially if you're using Euclidean distances. The Goslee and Urban JSS paper on the ecodist package goes into more detail (as do some of the references cited therein). 2) If env1 and another variable are correlated, is the appropriate test var1 ~ env1 + env2 + space?, or var1 ~ env1 + space and then var1 ~ env2 + space? Test for what? The first one partials out both env2 and space from the relationship of var1 ~ env1, a very different thing than the second example. 3) interpretation... Does the value of r (i.e. + or -) imply spatial overlap (+) or spatial exclusion (-)? A negative value for r is usually uninformative (unless you've used particular data transformations or something otherwise unusual). The Mantel test question is generally: do differences in X correspond to differences in Y, so the test you want is whether r 0. Again, see the JSS paper discusses this further. Sarah -- Sarah Goslee http://www.functionaldiversity.org __ R-help@r-project.org 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] plotting with gap in x-axis range
If plotrix does not help, you need to be mroe specific and give an example as the posting guide asks you to do anyway. Uwe Ligges BARRES-DE-ALMEIDA U. wrote: Hi, I need to make a plot of data from multiple epochs, and so I'd need to introduce a couple of breaks in the x-axis not to have too many empty space in my plot. I discovered a function in the package plotrix which makes breaks in axis, but it is not what I was actually looking for, because it doesn't really introduce the a range gap or rescale the plot according to the suppressed spaces. does anyone know of a function (or a procedure) that would do that for me? thanks and best regards, Ulisses. Ulisses Barres de Almeida, M.Sc. CAPES Ph.D. - Astrophysics The H.E.S.S. Collaboration University of Durham, England Time past and time future What might have been and what has been Point to one end, which is always present. T.S.Eliot - Burnt Norton, Four Quartets [[alternative HTML version deleted]] __ R-help@r-project.org 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@r-project.org 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] How to save independent R sessions in BATCH mode???
mcnda...@mncn.csic.es wrote: Hi guys, I already have put this question some time ago however replies were not straight to the problem. Even so thanks a lot for the answers! I reformulate the problem. I have a script file with the following commands: for (i in 1:300) - open session -- load(“X_i.rdata”) - perform some calcules -- (…) - save session -- save.image(“Y_i.rdata”) end for Put it into a function. That function accepts the objects you have had in X_i.rdata as arguments and that returns the objects you are gping to savein Y_i.rdata. Then you do not need to clean up/load/save all the time anymore. Uwe Ligges The problem here is that, I cannot save.image and begin a new “clean” session. An hypothesis could be to delete all R objects after the save.image, but this does not seem too efficient to perform. What should I do to begin a R clean session in the same batch processing? Are there any other suggestion on this? Thanks in advance, Diogo André Alagador __ R-help@r-project.org 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@r-project.org 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] cn is not a nb object
Dear all, I am trying to calculate barriers with the monmonier algorithm (adegenet). mon1 - monmonier(mycoordinates, mydistancamatrix, network$cn, ...) The network beforehand looked alright. However, I always get the error: cn is not a nb object. I am not really sure what this means, probably that the network is not recognised properly. So far I was not able to detect my fault, though I already installed the newest version of R and updated all packages (which was suggested in help files I have found during the search). Any help would be highly appreciated! Thanks in advance! Best regards Johannes __ R-help@r-project.org 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] graph resolution windows (dpi) using x11 device
Marta M. Rufino wrote: Dear colleagues, Thank you for the reply. Einer: I tried to so, but I had an error: Error in system(paste(gsexe, -help), intern = TRUE, invisible = TRUE) : gswin32c.exe not found I think would need |ghostscript| (in the help file: You will need |ghostscript|: the full path to the executable can be set by the environment variable R_GSCMD. (If this is unset the setting of GSC is used, otherwise command |gswin32c.exe|, which will work if it is in your PATH.) So why have you not tried to install it as explained in that help page? Uwe: I did so (the figures I sent were like these). The problem is that they want the A and B fig. together mounted, and both of them are so complex (to start with, one is lattice and the other is multi-panel grid plot) that I cannot mount it in R. I don't know how to do it with postcript See ?par and its argument mfrow. (mount two figures in the same page, besides I only have acrobat), so I was using GIMP with Tiff... but, there is the resolution problem :-( For my book, a publisher asked me to generate a better resolution for my bitmaps which in fact is a screenshot with a given fixed resolution from screen. Hence I used a graphics software and just increased resolution in terms of file size, not real resolution, since that could not be improved. This did not make sense at all, but they were happy. This is not nice at all... As the journals are becoming more and more noisy about this aspects, it would be excelent to sort this out in R, in an easy way...(developers? :-)) Well, in any case you should consider to use the proper devices directly rather than copy between devices. For the tiff() case: tiff has been introduced very recently and I doubt you are really going to have a tiff picture consisting of roughly 10e^7 points i.e. 30 Mb. It's already difficult to submit such a file to the publisher. Uwe Thank you, All the best, Marta __ R-help@r-project.org 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] Plotting questions
For question 2, dev.new (in more recent versions) will start a new instance of the default device (which are the ones listed below), but in a cross-platform way (so you don't need to remember all 3, and code will work on the other platforms). A link to dev.new should probably be included in the see also section of the help page for windows/x11/quartz, but I don't know if it is important enough for a formal bug report. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of richard.cot...@hsl.gov.uk Sent: Friday, May 08, 2009 4:01 AM To: lehe Cc: r-help@r-project.org; r-help-boun...@r-project.org Subject: Re: [R] Plotting questions 1. How to plot several lines in a figure? Suppose I have several sets of points (xi,yi), where xi and yi are equal-length vector. plot(x1,y1) will give a line connecting these points. Another plot(x2,y2) will erase what plot before and plot the new line. Can I have these lines all drawn in the same figure? #Draw your plot plot(seq(0,1,length.out=20)) #Add lines to the existing plot lines(runif(20)) #Add points to the existing plot points(runif(20), col=red) 2. How to open another figure window? Repeating plot will redraw in the same window instead of opening another one. On Windows, windows() will open a new figure window; quartz() on Mac OSX and x11() on Linux do the same. Regards, Richie. Mathematical Sciences Unit HSL --- - ATTENTION: This message contains privileged and confidential inform...{{dropped:20}} __ R-help@r-project.org 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@r-project.org 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] 'Dynamic' 3D plot
Some options: The rgl package The Rggobi package (along with the ggobi program) The rotate.cloud function in the TeachingDemos package (or tkexamp in the same package for a way to GUIize your favorite plot) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Martial Sankar Sent: Friday, May 08, 2009 2:26 AM To: rhelp Subject: [R] 'Dynamic' 3D plot Hi, I am looking for a R package to draw 3d plot. But not in a static way like scatterplot3d or stuff like that. I would like to make rotate the plot, to zoom/unzoom etc..., actually to render the graph 'dynamic'... (for the biologist and bioinformatician, a R package which permitts to reproduce what pdb viewer does). Does a Way exist to do something like that in R ? Thanks, _ Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! [[alternative HTML version deleted]] __ R-help@r-project.org 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] ADAPTIVE QUADRATURE WEIGHTS AND NODES
On Fri, May 8, 2009 at 7:07 AM, Boikanyo Makubate boika...@stats.gla.ac.uk wrote: Can anyone help me on how to get the nodes and weights of the adaptive quadrature using R. You need to be more specific about which quadrature formula. I'm guessing that you probably have Gauss-Hermite quadrature in mind because it is used when a density is approximated by a Gaussian density (the adaptive modifier refers to a process where the conditional mode and conditional variance are determined, given values of parameters). In that case you could start at http://en.wikipedia.org/wiki/Gauss-Hermite_Quadrature for the theory. There is C code in the lme4 package to compute the nodes and weights for Gauss-Hermite quadrature but we haven't written a public interface to it. You can try, for example library(lme4) .Call(lme4_ghq, 7) [[1]] [1] 2.6519614 1.6735516 0.8162879 0.000 -0.8162879 -1.6735516 -2.6519614 [[2]] [1] 0.0009717812 0.0545155828 0.4256072526 0.8102646176 0.4256072526 [6] 0.0545155828 0.0009717812 to get the nodes and the weights for a 7-point Gauss-Hermite quadrature. (There are two versions of the Hermite polynomials, the physicist's version where the kernel is exp(-x^2) and the probabilist's version where the kernel is exp(-(x^2)/2). I'm pretty sure these are from the physicist's version.) __ R-help@r-project.org 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] dotplot: labeling coordinates for each point
Thank you Deepayan! It works perfectly. Best, Tony -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Deepayan Sarkar Sent: Thursday, May 07, 2009 12:20 PM To: Qifei Zhu Cc: r-help@r-project.org Subject: Re: [R] dotplot: labeling coordinates for each point On Thu, May 7, 2009 at 7:42 AM, Qifei Zhu zhu_qi...@yahoo.com.sg wrote: Hi Deepayan, I guess I’m quite confusing when asking the question. I was actually looking for labels beside the dot in the graph (shown below), rather than the labels on the x-axis. Is that possible? Thanks a lot! In that case dotplot(y ~ x, xlab=Store, ylab=Revenue, main=test, scales=list(x = list(draw = FALSE)), panel = function(x, y, ...) { panel.dotplot(x, y, ...) id - y 90 panel.text(as.numeric(x[id]), y[id], labels = sprintf((%s,%g), as.character(x[id]), y[id]), pos = 4) }) -Deepayan Best, Tony -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Deepayan Sarkar Sent: Thursday, May 07, 2009 1:44 AM To: Qifei Zhu Cc: r-help@r-project.org Subject: Re: [R] dotplot: labeling coordinates for each point On Wed, May 6, 2009 at 6:54 PM, Qifei Zhu zhu_qi...@yahoo.com.sg wrote: Hi Deepayan, Thanks for the reply. here is a very simple example of what I'm looking for: y=c(100,0,-20) x=c(Atlanta, Baltimore, Berkeley CA) dotplot(y~x, xlab=Store, ylab=Revenue,main=test, scale=list(rot=60)) Basically it produces a graph of city on the x-axis and its associated revenue on the y-axis. In the real data set, the x-axis will be filled of tens or even hundreds of cities, so I wanna label the dots in the graph whenever the revenue (y value) is greater than a threshold, let's say 90 in this case. The labels should be in (x,y) format, which is (Atlanta, 100) in this case. Appreciate a lot for your help! dotplot(y~x, xlab=Store, ylab=Revenue,main=test, xlim = ifelse(y 90, sprintf((%s,%g), x, y), ), scales=list(rot=60)) -Deepayan Best, Tony -Original Message- From: Deepayan Sarkar [mailto:deepayan.sar...@gmail.com] Sent: Wednesday, May 06, 2009 8:40 PM To: Qifei Zhu Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] dotplot: labeling coordinates for each point On Tue, May 5, 2009 at 7:04 PM, Qifei Zhu zhu_qi...@yahoo.com.sg wrote: Hi Deepayan, Thanks for the hint. I spent some time on the research but haven't got any luck in writing the custom panel function for the conditional labeling of points in a graph. Could you please provide some more thoughts and probably some pseudo code? Thank you so much for your time! I'll be happy to try if you provide a reproducible example. -Deepayan __ R-help@r-project.org 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@r-project.org 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@r-project.org 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] graph resolution windows (dpi) using x11 device
Marta You have to install ghostscript and update your R to the latest version. Here is a test function I used when trying this out a while ago. You could plot different parts of your figure using a similar approach. The bitmap option of my function dropped colors from the lattice panels. However, plotting on an X11 device and then using dev2bitmap reproduced the figure in color at 1200 dpi. With lzw compression the file was of manageable size. Einar `newtest` - function(tiff=F, bitmap=F) { ### requires states ### states - data.frame(state.x77, state.name = dimnames(state.x77)[[1]], state.region = state.region) if(bitmap) bitmap(bitmaptest.tiff, width=17.15, height=17.15, units=cm, res=1200, pointsize=10, type=tiff24nc,bg=white) if(tiff) tiff(file=tifftest.tiff,width=17.15,height=17.15,units=cm, res=1200, pointsize=10, compression = lzw) ### tiff(file=tifftest.tiff,width=17.15,height=17.15,units=cm, res=72, pointsize=10, compression = lzw) foo - xyplot(Murder ~ Population | state.region, data = states, groups = state.name, panel = function(x, y, subscripts, groups) ltext(x = x, y = y, label = groups[subscripts], cex=0.5, fontfamily = HersheySans)) plot(foo,position=c(0,0,0.33,1)) plot(foo,position=c(0.33,0,0.66,1), newpage=FALSE) plot(foo,position=c(0.66,0,0.99,1), newpage=FALSE) if(bitmap) dev.off() if(tiff) dev.off() } 2009/5/8 Uwe Ligges lig...@statistik.tu-dortmund.de Marta M. Rufino wrote: Dear colleagues, Thank you for the reply. Einer: I tried to so, but I had an error: Error in system(paste(gsexe, -help), intern = TRUE, invisible = TRUE) : gswin32c.exe not found I think would need |ghostscript| (in the help file: You will need |ghostscript|: the full path to the executable can be set by the environment variable R_GSCMD. (If this is unset the setting of GSC is used, otherwise command |gswin32c.exe|, which will work if it is in your PATH.) So why have you not tried to install it as explained in that help page? Uwe: I did so (the figures I sent were like these). The problem is that they want the A and B fig. together mounted, and both of them are so complex (to start with, one is lattice and the other is multi-panel grid plot) that I cannot mount it in R. I don't know how to do it with postcript See ?par and its argument mfrow. (mount two figures in the same page, besides I only have acrobat), so I was using GIMP with Tiff... but, there is the resolution problem :-( For my book, a publisher asked me to generate a better resolution for my bitmaps which in fact is a screenshot with a given fixed resolution from screen. Hence I used a graphics software and just increased resolution in terms of file size, not real resolution, since that could not be improved. This did not make sense at all, but they were happy. This is not nice at all... As the journals are becoming more and more noisy about this aspects, it would be excelent to sort this out in R, in an easy way...(developers? :-)) Well, in any case you should consider to use the proper devices directly rather than copy between devices. For the tiff() case: tiff has been introduced very recently and I doubt you are really going to have a tiff picture consisting of roughly 10e^7 points i.e. 30 Mb. It's already difficult to submit such a file to the publisher. Uwe Thank you, All the best, Marta -- - Einar Arnason, Professor einar...@hi.is Institute of Biology University of Iceland Askja # 346 office 354-525-4613 Sturlugata 7 lab 354-525-4606 101 Reykjavikfax 354-525-4069 Iceland - [[alternative HTML version deleted]] __ R-help@r-project.org 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] ADAPTIVE QUADRATURE WEIGHTS AND NODES
Beyond what Doug said, if you have a specific R function that does adaptive quadrature, you could read the code for that function. You can get that without comments by typing the function name at a commands prompt. To get the source code with comments, you can download the appropriate source code in *.tar.gz format from your favorite CRAN mirror. If the function you want is in the base system, click R Sources - R-2.9.0.tar.gz from your favorite CRAN mirror. For a contributed packages, click Packages two lines below R Sources. The following will search help files for adaptive quadrature: library(RSiteSearch) aq - RSiteSearch.function('adaptive quadrature') summary(aq) HTML(aq) Hope this helps. Spencer Graves Douglas Bates wrote: On Fri, May 8, 2009 at 7:07 AM, Boikanyo Makubate boika...@stats.gla.ac.uk wrote: Can anyone help me on how to get the nodes and weights of the adaptive quadrature using R. You need to be more specific about which quadrature formula. I'm guessing that you probably have Gauss-Hermite quadrature in mind because it is used when a density is approximated by a Gaussian density (the adaptive modifier refers to a process where the conditional mode and conditional variance are determined, given values of parameters). In that case you could start at http://en.wikipedia.org/wiki/Gauss-Hermite_Quadrature for the theory. There is C code in the lme4 package to compute the nodes and weights for Gauss-Hermite quadrature but we haven't written a public interface to it. You can try, for example library(lme4) .Call(lme4_ghq, 7) [[1]] [1] 2.6519614 1.6735516 0.8162879 0.000 -0.8162879 -1.6735516 -2.6519614 [[2]] [1] 0.0009717812 0.0545155828 0.4256072526 0.8102646176 0.4256072526 [6] 0.0545155828 0.0009717812 to get the nodes and the weights for a 7-point Gauss-Hermite quadrature. (There are two versions of the Hermite polynomials, the physicist's version where the kernel is exp(-x^2) and the probabilist's version where the kernel is exp(-(x^2)/2). I'm pretty sure these are from the physicist's version.) __ R-help@r-project.org 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@r-project.org 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] plm: plm.data vs pdata.frame
Hello, I am trying to use the plm package for panel econometrics. I am just trying to get started and load my data. It seems from most of the sample documentation that I need to use the pdata.frame function to get my data loaded. However, even after installing the plm package, my R installation cannot find the function. I am trying to follow the example in plmEN.pdf ( cran.mirroring.de/doc/vignettes/plm/plmEN.pdf ) library(plm) Loading required package: kinship Loading required package: survival Loading required package: splines Loading required package: nlme Loading required package: lattice [1] kinship is loaded Loading required package: Formula Loading required package: MASS Loading required package: sandwich Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric library(Ecdat) data(Hedonic) pdata.frame(Hedonic, townid) Error: could not find function pdata.frame From here, I decided to try using plm.data, which worked h2 - plm.data(Hedonic, townid) However, doing a summary of the h2 object, it was not as in the plmEN.pdf example, meaning it did not show any information about the panel structure of the object. I would appreciate some help as to getting my data into a proper pdata.frame. Thank you, -stephen barr == Stephen J. Barr University of Washington WEB: www.econsteve.com __ R-help@r-project.org 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] I'm offering $300 for someone who know R-programming to do the assignments for me.
Simon Pickett wrote: I bet at least a few people offered their services! It might be an undercover sting operation to weed out the unethical amongst us :-) ... written by some of the r core developers? vQ __ R-help@r-project.org 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] Probit cluster-robust standard errors
If I wanted to fit a logit model and account for clustering of observations, I would do something like: library(Design) f - lrm(Y1 ~ X1 + X2, x=TRUE, y=TRUE, data=d) g - robcov(f, d$st.year) What would I do if I wanted to do the same thing with a probit model? ?robcov says the input model must come from the Design package, but the Design package appears not to do probit? Thanks very much! FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks orcas on your desktop! Check it out at http://www.inbox.com/marineaquarium __ R-help@r-project.org 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 to extract results from lme.object
Hi list, Would someone please give me a hint how to extract the between and within subject StdDev from lme fit? Below is the output from the fit, but I couldn't find the number 0.3927714 anywhere in the fitted object. Thanks in advance for your help! Random effects: Formula: ~1 | group (Intercept) Residual StdDev: 0.3927714 0.7857085 Best, Auston __ R-help@r-project.org 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] RGoogleDocs
Robert Schneider wrote: Hi there, I'm not certain if this is the correct list where to post this question, or if it ought to be on the R developper one... I am trying to use the RGoogleDocs package to import into R the spreadsheets on my Google docs account. I downloaded the latest package (0.2.0) and installed it. I can get a connection going, but it seems that I can only get a doc one... This is the correct list. And it is best to email the author of the package first. Here is the code I am using: library(RGoogleDocs) auth = getGoogleAuth(loginName, psswrd, service=wise) sheets.con = getGoogleDocsConnection(auth) a - getDocs(sheets.con) I get the following error: Error in checkSlotAssignment(object, name, value) : assignment of an object of class NULL is not valid for slot access in an object of class GoogleSpreadsheet; is(value, character) is not TRUE This turns out to be a simple case of the feedLink/access information not always being present in the resulting XML returned via the query. A new version of the package is on the Omegahat repository that fixes this. Thanks for pointing it out. D. If i change the service to writely, I get the full listing of the google docs and cannot import a spreadsheet due to the fact that the sheets.con is of the wrong class. Any help would be appreciated ! I am running under Ubunto 8.10 if that can help... Thanks. Robert _ [[alternative HTML version deleted]] __ R-help@r-project.org 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@r-project.org 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] Help to extract results from lme.object
Auston wrote: Hi list, Would someone please give me a hint how to extract the between and within subject StdDev from lme fit? Below is the output from the fit, but I couldn't find the number 0.3927714 anywhere in the fitted object. Thanks in advance for your help! Random effects: Formula: ~1 | group (Intercept) Residual StdDev: 0.3927714 0.7857085 Best, Auston __ R-help@r-project.org 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. Hi Auston, Extracting those standard deviation values isn't so hard. If you want to extract the variance on your parameter estimates, use diag(lme.output$varFix) ; If you want to extract the variance for the random effects, use as.numeric(VarCorr(lme.output)[,Variance]) ; At last, if you want your within-group error standard deviation, simply try lme.output$sigma ; Is there something missing? Cheers, -- *Luc Villandré* /Biostatistician McGill University Health Center - Montreal Children's Hospital Research Institute/ __ R-help@r-project.org 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] Installing RGtk2 on Mac OS
I'm having trouble to install RGtk2 (from source) on Mac OS 10.4.11 (R 2.9.0). The GTK libraries (2.12.11) were installed into /sw/lib via fink. Even if I set the GTK_LIBS to that path, the installation program doesn't seem to find it (see below). libglade is there too but not found. If I install the package from binaries, it fails on load. Would anybody know how to make it work? Thanks a lot, Hana $ echo $GTK_LIBS /sw/lib $ R CMD INSTALL RGtk2 * Installing to library '/Library/Frameworks/R.framework/Resources/library' * Installing *source* package 'RGtk2' ... checking for pkg-config... /sw/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBGLADE... no configure: WARNING: libglade not found rm: R/libglade*: No such file or directory rm: src/libglade*: No such file or directory checking for INTROSPECTION... no checking for GTK... no configure: error: GTK version 2.8.0 required ERROR: configuration failed for package 'RGtk2' * Removing '/Library/Frameworks/R.framework/Resources/library/RGtk2' __ R-help@r-project.org 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] Rmysql linking to an old-ish mysql build
Hi, I'm trying to get Rmysql to work o windows server 2008 64-bit. I have the latest build of mysql installed (mysql-5.1.34-winx64). When trying to load Rmysql, I got a warning that Rmysql is linking to an old-ish mysql build (5.0.67). I could do some basic stuff (the connection works) but it breaks when trying to read a large table. So I set up to use the buld 5.0.67 that Rmysql likes. 10 hrs later and after lots of sysadmin work, I have to call it quits. I couldn't make it work. Since this mysql 5.0.67 is pretty old, I was wondering if anyone has binaries for Rmysql that work for a more recent version. Maybe the authors of the package have plans to update it soon? I've tried the package on both R 2.9.0 and R2.8.1. If nothing comes up, I'll try to spend a few more hours on getting the old version to work. Thanks! Best, -Jose -- Jose Quesada, PhD. Max Planck Institute, Center for Adaptive Behavior and Cognition -ABC-, Lentzeallee 94, office 224, 14195 Berlin http://www.josequesada.name/ __ R-help@r-project.org 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] display data ( text) on leveplot / Superpose panel
On Thu, May 7, 2009 at 10:13 PM, kulwinder banipal kbani...@hotmail.com wrote: I am trying to display data ion top of colored rectangle on the same levelplot. While using superpose the shape and symbol for levelplot changes to small circle. I am unable to figure what exactly I am doing wrong... It may be straightforward solution... .I will appreciate help to fix this issue. brewer.div-colorRampPalette(c(pink,green,blue,yellow,red), interpolate=linear)levelplot(ds, shrink=c(0.9,1), aspect=3/5, scales=list(x=list(rot=0)), cuts = 10, col.regions = brewer.div(20), xlab=, ylab= , main= , panel = function(x,y,z,...) { panel.superpose(x,y,z,...) Why panel.superpose? Instead, try panel.levelplot(x,y,z,...) ltext(x,y,paste(z), adj=c(0,2), cex=.8, col='black')} ) -Deepayan where ds is matrix pct20 pct40 pct60 pct80 pct100A 16 18 6 2 0C 19 11 7 0 0D 9 16 2 0 0E 135 9 0 0 0J 90 57 3 1 0M 47 17 1 0 0T 19 9 3 1 0 ThanksKulwinder Banipal _ Hotmail® goes with you. ial_Mobile1_052009 [[alternative HTML version deleted]] __ R-help@r-project.org 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@r-project.org 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] Help to extract results from lme.object
Dear Luc, Thank you so much for your help! The VarCorr() did the trick. Many thanks! Best, Auston __ R-help@r-project.org 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] Installing RGtk2 on Mac OS
Please use R-sig-mac for Mac OS X questions, as the posting guide asks. But there is a binary of Gtk2 on r.research.att.com that matches the binary RGtk2 package on CRAN, and that worked for me earlier today. Mixing fink (or darwinports) with the binary R distribution is warned against in the R Mac OS X documentation. On Fri, 8 May 2009, Hana Sevcikova wrote: I'm having trouble to install RGtk2 (from source) on Mac OS 10.4.11 (R 2.9.0). The GTK libraries (2.12.11) were installed into /sw/lib via fink. Even if I set the GTK_LIBS to that path, the installation program doesn't seem to find it (see below). libglade is there too but not found. If I install the package from binaries, it fails on load. Would anybody know how to make it work? Thanks a lot, Hana $ echo $GTK_LIBS /sw/lib $ R CMD INSTALL RGtk2 * Installing to library '/Library/Frameworks/R.framework/Resources/library' * Installing *source* package 'RGtk2' ... checking for pkg-config... /sw/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBGLADE... no configure: WARNING: libglade not found rm: R/libglade*: No such file or directory rm: src/libglade*: No such file or directory checking for INTROSPECTION... no checking for GTK... no configure: error: GTK version 2.8.0 required ERROR: configuration failed for package 'RGtk2' * Removing '/Library/Frameworks/R.framework/Resources/library/RGtk2' __ R-help@r-project.org 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. -- Brian D. Ripley, rip...@stats.ox.ac.uk 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@r-project.org 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] documenting quirky behavior of as.POSIXct, as.POSIX.lt regarding AM/PM, possibly other cases
Also works as expected on the MacOSX 64 bit binary for R 2.8.1 (patched). On May 5, 2009, at 4:06 PM, jim holtman wrote: Seems to work fine for me on R 2.9.0: as.POSIXct(2009/03/26 01:00:00 AM , format=%Y/%m/%d %I:%M:%S %p ) [1] 2009-03-26 01:00:00 GMT as.POSIXct(2009/03/26 01:00:00 PM , format=%Y/%m/%d %I:%M:%S %p ) [1] 2009-03-26 13:00:00 GMT On Tue, May 5, 2009 at 2:55 PM, Galkowski, Jan jgalk...@akamai.com wrote: I wanted to put this on the R Wiki, but found the suitable pages were read-only. I wanted to get it out in public to save people work. I was converting dates like 2009/03/26 01:00:00 AM using as.POSIXct. I found that using a format of %Y/%m/%d %I:%M:%S %p did not work correctly to distinguish AM from PM. Both were converted into the same timestamp. Indeed, what I found worked was affixing a space after the string timestamp to produce 2009/03/26 01:00:00 AM or 2009/03/26 01:00:00 PM . That works. Didn't see this documented in the associated pages anywhere. I wonder if the help system might benefit from user comments like for instance PHP has? -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org 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] caching of the .Rprofile file
Hi, It seems that if I make a change to the .Rprofile file in my working directory, it is not immediately reflected when the session is restarted. (I am using statET and rJava) Is that something I should expect? Thanks, #T __ R-help@r-project.org 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] centering axis labels in lattice
On Fri, May 8, 2009 at 8:08 AM, Paul Boutros paul.bout...@utoronto.ca wrote: Hello, I'm attempting to alter the location of text in my axis labels in lattice plots and have been unsuccessful so far. For example, the y-axis labels are always right-justified, but I would like them to be horizontally centered. Here's an example: library(lattice); # create fake dataset to plot to.plot - data.frame( x = 1:5, y = c(1\nAAA, 2\nBBB, 3\nCCC, 4\nDDD, 5\nEEE) ); # initial plot, note that the y-axis labels are right-justified xyplot( y ~ x, to.plot, pch = 19, ylab = , xlab = , cex = 3 ); # now try to set the positioning via scales xyplot( y ~ x, to.plot, pch = 19, ylab = , xlab = , cex = 3, scales = list( labels = to.plot$y, hjust = 0.5, vjust = 0.5 ) ); I also explored using yscale.components.default(), but specifying hjust and vjust there did not help. Any suggestions would be very much appreciated! The justification calculations are hard-coded in the default axis function 'axis.default' (mainly to handle rotated labels). You can provide your own axis function to override this. A general replacement would be a lot more complicated, but this should suffice for your example (it could be simplified further if you don't care about tick marks). axis.y - function(side, components, ...) { if (side == left) { require(grid) str(components) axis.units - lattice.getOption(axis.units)[[outer]][[left]] axis.settings - trellis.par.get(axis.components)[[left]] tck.unit.x - components$left$ticks$tck * axis.settings$tck * axis.units$tick$x tck.unit - unit(x = tck.unit.x, units = axis.units$tick$units) with(components$left$ticks, { grid.segments(y0 = unit(at, native), y1 = unit(at, native), x0 = unit(0, npc), x1 = -1 * tck.unit) }) with(components$left$labels, { lab.unit - tck.unit + unit(x = axis.settings$pad1 * axis.units$pad1$x, units = axis.units$pad1$units) + 0.5 * unit(1, grobwidth, textGrob(labels)) grid.text(label = labels, y = unit(at, native), x = -1 * lab.unit, just = center) }) } else axis.default(side = side, components = components, ...) } xyplot(y ~ x, to.plot, pch = 19, ylab = , xlab = , cex = 3, axis = axis.y) At some point I should allow the labels to be grobs, which should make things like this a bit simpler. -Deepayan __ R-help@r-project.org 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] Plotting counts vs. intervals for a shingle
Took a bit of inspecting, looking at hidden functions, but this seems to do it: library(lattice) a - c(1:10, 5:10) b - cbind(c(0,2.5,4.5,6.5), c(5.5,7.5,9.5,11)) c - shingle(a, b) summary(c, showValues=FALSE) apply(as.matrix(levels(c)), 1, function(x) length(c[ c= x[[1]][1] c = x[[1]][2] ]) ) #[1] 6 8 10 8 apply passes a list to the function which requires the [[ operation before the index. Since you did not create an example that represents the exceptions, i did not test for any such conditions. (Why do people not construct proper examples?) -- David On May 7, 2009, at 9:55 AM, Walcerz, Douglas (APG) wrote: Hello! Suppose I have a set of values: a - c(1:10, 5:10) Suppose I also have a set of intervals: b - cbind(c(0,2.5,4.5,6.5), c(5.5,7.5,9.5,11)) I can create a shingle that counts how many values are in each interval: c - shingle(a, b) I can display the shingle to see the counts: summary(c, showValues=FALSE) The display looks like this: Intervals: min max count 1 0.0 5.5 6 2 2.5 7.5 8 3 4.5 9.510 4 6.5 11.0 8 Overlap between adjacent intervals: [1] 4 6 6 I would like to plot the count vs. the Intervals I can create a vector representing the intervals: labels - as.character(levels(c)) But I can't seem to create a vector of counts, which would permit me to plot counts vs. intervals. Thanks for any insights you can provide. p.s. My real data contains 25,094 values and 5,809 intervals. Many of the intervals will not contain any of the values. -Douglas David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org 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] Vim R plugin-2
Dear R users, People who uses vim in Linux/Unix may be interested in checking the plugin for R that I'm developing: http://www.vim.org/scripts/script.php?script_id=2628 The plugin includes omni completion for R objects, code indentation and communication with R running in a terminal emulator (xterm or gnome-terminal). This last feature was already present in Johannes Ranke's plugin. I would like to know if you have any suggestions of improvements. Best regards, -- Jakson Aquino Professor of Political Science Federal University of Ceará Brazil __ R-help@r-project.org 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] Plotting counts vs. intervals for a shingle
On Fri, May 8, 2009 at 1:30 PM, David Winsemius dwinsem...@comcast.net wrote: Took a bit of inspecting, looking at hidden functions, but this seems to do it: library(lattice) a - c(1:10, 5:10) b - cbind(c(0,2.5,4.5,6.5), c(5.5,7.5,9.5,11)) c - shingle(a, b) summary(c, showValues=FALSE) apply(as.matrix(levels(c)), 1, function(x) length(c[ c= x[[1]][1] c = x[[1]][2] ]) ) #[1] 6 8 10 8 apply passes a list to the function which requires the [[ operation before the index. Since you did not create an example that represents the exceptions, i did not test for any such conditions. (Why do people not construct proper examples?) Noting that str(levels(c)) List of 4 $ : num [1:2] 0 5.5 $ : num [1:2] 2.5 7.5 $ : num [1:2] 4.5 9.5 $ : num [1:2] 6.5 11 - attr(*, class)= chr shingleLevel I would suggest the slightly simpler sapply(levels(c), function(x) sum(x[1] = c c = x[2])) [1] 6 8 10 8 -Deepayan __ R-help@r-project.org 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] by-group processing
sorry about the mistake - the -data$Type doesn't work: the '-' sign isn't valid for factors. I *thought* I had checked this before submitting a response ! HufferD wrote: On Thursday, May 07, 2009 7:45 PM, David Freedman wrote: ...how about: d=data[order(data$ID,-data$Type),] d[!duplicated(d$ID),] Does the -data$Type argument to the order function work? -- David - David Huffer, Ph.D. Senior Statistician CSOSA/Washington, DC david.huf...@csosa.gov __ R-help@r-project.org 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. -- View this message in context: http://www.nabble.com/by-group-processing-tp23417208p23453688.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.