[R] New York Times - R - article a fraud?
I worked on some ad data before and I found NYT article very biaised and not far from a fraud... Anyone knows if they got money from a - company - to play 'R'? Check out the title: R U Ready for R? Seems to me this title was stolen from XLSolutionswww.xlsolutions-corp.com and they never mentioned XLSolutions in the article! They mentioned commercial Rnever mentioned R-PLUS (www.experience-rplus.com), nor RSTAT (http://random-technologies-llc.com). I attended Trevor's class and his comment on the article is alarming: --- As a long time user of S, Splus and now R, I loved the article on R until I read the paragraph on how it all started. I quote: “According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use.” This is grossly ungenerous to the original inventors of the wonderful S language underlying the R system. --- I think R community should report this fraudulent article to the NYT ed board. It's fraud, not journalism and someone has to say it! 1- They got money for itfine it's business as usual (unless someone knows someone and took some bribes). Yes... One company seems to appear many many times in the article... 2- It's a 'free' article, then it's rubish as usual. __ 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] problem with subsetting in compating one column with a vector
Hi all, I got one problem withsubset()function hear i executed: findings1-subset(findings,SUBJECTSID==SUBJECTS1$SUBJECTSID,select=c(SUBJECTSID,ORGNUMRES)) hear SUBJECTS1$SUBJECTSID vector contains nearly 65 values the problem is after comparing and subsetting its not giving all the values related to that instead its giving randam values and giving warning that: Warning message: In SUBJECTSID == SUBJECTS1$SUBJECTSID : longer object length is not a multiple of shorter object length can any one suggest what I can do to retreave all the related data of subset and store in one object thanks in advance regards; kiran [[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] Lattice histogram with vertical lines
David Scott d.scott at auckland.ac.nz writes: I would like to add some vertical lines to a lattice plot of histograms. What I am after is a lattice version of abline(v = 1234). The lattice histogram plot is just: histogram( ~ LTSE | approach, data = arrivals) As a little variation on the histogram docs example: histogram( ~ height | voice.part, data = singer, xlab = Height (inches), type = density, panel = function(x, ...) { panel.histogram(x, ...) panel.abline(v= 70) panel.mathdensity(dmath = dnorm, col = black, args = list(mean=mean(x),sd=sd(x))) } ) Dieter __ 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] KS test for gumbel distribution
Dear all, I have a question about the ks.test() function, in order to perform a Kolmogorov-Smirnov test. I have a sample, and I fitted it to the 2-parameter gumbel distirbution using gum.fit () fuction in the ismev package. I would like to perform a KS test if its distribution is gumble but I can't find useful information in ks.test help page. Can anyone tell me how to perform the ks test. Thanks a lot for your help. -- Wang Yi START Regional Center for Temperate East Asia(TEA), Institute of Atmospheric Physics(IAP), Chinese Academy of Sciences(CAS), Qijiahuozi Huayanli 40#, P.O.Box 9804, Beijing 100029,China Tel:13466795920 E-mail:wan...@tea.ac.cn __ 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] Collapsing panel data
Dear R-helpers, I've been thinking about this for some time, maybe someone can help. I have a fairly large dataset with thousands of firms, call the a, b, c, etc.. such as [,1] [,2] [1,] A0.5 [2,] 0.2 [3,] 0.3 [4,] B0.1 [5,] 0.9 [6,] C0.4 Or to put it differently two vectors such as y - c(A, , , B, , C) x - c(0.5, 0.2, 0.3, 0.1, 0.9, 0.4) The empty lines always belong to the firm above. Now I want to collapse the dataset so that each firm (A,B, C, etc) has one line only, using summation. So what I would like is yNew - c(A, B, C) xNew - c(1, 1, 0.4) The problem I'm having is that each firm has a different number of entries for x, so some like C have just one and others have ten or more, so I have difficulty imagining how to use a loop in this case. I'd be greatful for any suggestions. Karina __ 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] Event sequence analysis
Jean-Pierre Müller jean-pierre.mueller at unil.ch writes: Maybe TraMineR ? http://mephisto.unige.ch/traminer HTH, Thanks for pointing out TraMineR; it is a very interesting package on sequences of events and states in social science. Unfortunately, it appears not provide the kind of windowing or counting of subsequences that I was asking for. Therefore, I am still looking for implementations of procedures for event sequence analysis as provided in some data mining tools and applications, see for example the article cited below. Any help would be very much appreciated. Thanks, Hans Werner Borchers Le 2 févr. 09 à 13:31, Hans W. Borchers a écrit : Dear R help, I am analyzing sequences of events described by time and a unique event tag. And I am searching for recurring patterns where patterns have to show up in a certain time window, e.g. 5 or 10 minutes. Of course, inbetween these events other events may occur. I have applied basket analysis approaches like apriori or 'frequent item set' algorithms with interesting results but these methods do not take into account the exact succession of events. I also looked into the 'Generalized Sequential Pattern' function of Weka, but the implementation in Weka does not allow for a time window (as far as I understand). Are there other sequence analysis implementations available in R? -- For instance in the realm of the 1997 paper Discovery of frequent episodes in event sequences by H. Mannila et al. Please no BioConductor hints as they are meaning something different with (genetic) sequence analysis. Very best, Hans Werner __ 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] Difference between a[[i]] and a[i]
Rolf Turner wrote: On 3/02/2009, at 12:45 PM, David Epstein wrote: I'm sure I've read about the difference between a[[i]] and a[i] in R, but I cannot recall what I read. Even more disturbing is the fact that I don't know how to search the newsgroup for this. All the different combinations I tried were declared not to be valid search syntax. Essentially: a is a list; a[i] is a list of length 1 whose sole entry is the i-th entry of a; a[[i]]] is the i-th entry of a. If you are of a mathematical bent it may be illuminating to think of this as being analogous to, say, {3} being a subset of the set {1,2,3,4,5} and 3 being an element of this set. 1. What sort of object can the operators [] and [[]] be applied to? How do they differ? I mean objects in standard R, not in packages that provide conceivable overloading of these operators (if that's possible). Essentially lists. Note that any vector can be considered to be a list. what do you mean by 'can be considered to be a list'? by whom? not by the r interpreter, it seems: v = 1:10 # a vector l = as.list(1:10) # a list is.list(v) # no is.list(l) # yes is(v, list) # no is(l, list) # yes is(v) # integer vector numeric data.frameRowLabels is(l) # list vector d = data.frame(x=1:10) aggregate(d, by=v) # error: 'by' must be a list aggregate(d, by=l) # fine sort(l) # error: have you called 'sort' on a list? sort(v) # fine, no error # and the best of all sort.list(l) # error: have you called 'sort' on a list? sort.list(v) # fine, no error perhaps you'd care to explain what 'can be considered to be a list' is supposed to mean precisely, or else you're messing things up. 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.
Re: [R] New York Times - R - article a fraud?
you should wait for the article on R by fox news Calvin Trillin - Health food makes me sick. On Tue, Feb 3, 2009 at 6:19 AM, eugene dalt eugened...@yahoo.com wrote: I worked on some ad data before and I found NYT article very biaised and not far from a fraud... Anyone knows if they got money from a - company - to play 'R'? Check out the title: R U Ready for R? Seems to me this title was stolen from XLSolutionswww.xlsolutions-corp.com and they never mentioned XLSolutions in the article! They mentioned commercial Rnever mentioned R-PLUS ( www.experience-rplus.com), nor RSTAT (http://random-technologies-llc.com ). I attended Trevor's class and his comment on the article is alarming: --- As a long time user of S, Splus and now R, I loved the article on R until I read the paragraph on how it all started. I quote: According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use. This is grossly ungenerous to the original inventors of the wonderful S language underlying the R system. --- I think R community should report this fraudulent article to the NYT ed board. It's fraud, not journalism and someone has to say it! 1- They got money for itfine it's business as usual (unless someone knows someone and took some bribes). Yes... One company seems to appear many many times in the article... 2- It's a 'free' article, then it's rubish as usual. __ 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] Odp: Collapsing panel data
Hi r-help-boun...@r-project.org napsal dne 03.02.2009 09:43:04: Dear R-helpers, I've been thinking about this for some time, maybe someone can help. I have a fairly large dataset with thousands of firms, call the a, b, c, etc.. such as [,1] [,2] [1,] A0.5 [2,] 0.2 [3,] 0.3 [4,] B0.1 [5,] 0.9 [6,] C0.4 Or to put it differently two vectors such as y - c(A, , , B, , C) x - c(0.5, 0.2, 0.3, 0.1, 0.9, 0.4) The empty lines always belong to the firm above. Now I want to collapse the dataset so that each firm (A,B, C, etc) has one line only, using summation. So what I would like is yNew - c(A, B, C) xNew - c(1, 1, 0.4) That is what are NA values for. There are quite useful functions for handling them. y - c(A, , , B, , C) x - c(0.5, 0.2, 0.3, 0.1, 0.9, 0.4) y[y==]-NA from package zoo y.na-na.locf(y) tapply(x,y.na, sum) A B C 1.0 1.0 0.4 or aggregate(...) Regards Petr The problem I'm having is that each firm has a different number of entries for x, so some like C have just one and others have ten or more, so I have difficulty imagining how to use a loop in this case. I'd be greatful for any suggestions. Karina __ 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] Lattice histogram with vertical lines
Hi r-help-boun...@r-project.org napsal dne 03.02.2009 09:20:25: David Scott d.scott at auckland.ac.nz writes: I would like to add some vertical lines to a lattice plot of histograms. What I am after is a lattice version of abline(v = 1234). The lattice histogram plot is just: histogram( ~ LTSE | approach, data = arrivals) As a little variation on the histogram docs example: histogram( ~ height | voice.part, data = singer, xlab = Height (inches), type = density, panel = function(x, ...) { panel.histogram(x, ...) panel.abline(v= 70) panel.mathdensity(dmath = dnorm, col = black, args = list(mean=mean(x),sd=sd(x))) } ) Or if you want add lines at different places in each panel use this function and set once =T addLine- function(a=NULL, b=NULL, v = NULL, h = NULL, ..., once=F) { tcL - trellis.currentLayout() k-0 for(i in 1:nrow(tcL)) for(j in 1:ncol(tcL)) if (tcL[i,j] 0) { k-k+1 trellis.focus(panel, j, i, highlight = FALSE) if (once) panel.abline(a=a[k], b=b[k], v=v[k], h=h[k], ...) else panel.abline(a=a, b=b, v=v, h=h, ...) trellis.unfocus() } } Regards Petr Dieter __ 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] New York Times - R - article a fraud?
Hi, it seems to me that this article in the NYT started many discussions. Maybe I missed it but are there some responses to the article by Ihaka Gentleman? Or maybe by John Chambers as the central person for the development of S (hope I am not mistaken here)? I'd be more interested in their opinions than another outrage! posting. Thanks, Roland -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eugene dalt Sent: Tuesday, February 03, 2009 1:49 AM To: r-h...@stat.math.ethz.ch Subject: [R] New York Times - R - article a fraud? I worked on some ad data before and I found NYT article very biaised and not far from a fraud... Anyone knows if they got money from a - company - to play 'R'? Check out the title: R U Ready for R? Seems to me this title was stolen from XLSolutions www.xlsolutions-corp.com and they never mentioned XLSolutions in the article! They mentioned commercial Rnever mentioned R-PLUS (www.experience-rplus.com), nor RSTAT (http://random-technologies-llc.com). I attended Trevor's class and his comment on the article is alarming: -- - As a long time user of S, Splus and now R, I loved the article on R until I read the paragraph on how it all started. I quote: According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use. This is grossly ungenerous to the original inventors of the wonderful S language underlying the R system. -- - I think R community should report this fraudulent article to the NYT ed board. It's fraud, not journalism and someone has to say it! 1- They got money for itfine it's business as usual (unless someone knows someone and took some bribes). Yes... One company seems to appear many many times in the article... 2- It's a 'free' article, then it's rubish as usual. __ 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 mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance. __ 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 getSymbols
xts has a bracket notation like this: u - getSymbols(PPIACO, src=FRED, verbose=TRUE, auto.assign=FALSE) u[1970::] and zoo uses window just like ts does: z - as.zoo(u) window(z, start = 1970-01-01) On Mon, Feb 2, 2009 at 11:58 PM, Shruthi Jayaram shruthi.jayaram...@gmail.com wrote: Hi, How can one ask getSymbols to obtain data within a specified time interval? For example, if I am downloading US PPI data: usppi - as.zoo(getSymbols(PPIACO, src=FRED, verbose=TRUE, auto.assign=FALSE)) How do I ask getSymbols to truncate starting from Jan-1970 until present? I looked up the help file but couldn't find anything. Another newbie question, can I specify the frequency of the data I want from FRED? The USPPI data above gives me monthly data, is there a way I can ask to obtain annual data? Thanks very much, I'd be grateful for any help on this. Shruthi -- View this message in context: http://www.nabble.com/Using-getSymbols-tp21803950p21803950.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.
[R] Odp: problem with subsetting in compating one column with a vector
Hi r-help-boun...@r-project.org napsal dne 03.02.2009 09:11:52: Hi all, I got one problem withsubset()function hear i executed: findings1-subset(findings,SUBJECTSID==SUBJECTS1$SUBJECTSID,select=c + (SUBJECTSID,ORGNUMRES)) Error in subset(findings, SUBJECTSID == SUBJECTS1$SUBJECTSID, select = c(SUBJECTSID, : object findings not found Gives me an error. Strange, is it possible that I do not have SUBJECTS1 or SUBJECTSID on my computer? however subset(iris, subset=iris$Species==virginica, select=c(Sepal.Length, Petal.Length)) Sepal.Length Petal.Length 101 6.3 6.0 102 5.8 5.1 103 7.1 5.9 104 6.3 5.6 105 6.5 5.8 106 7.6 6.6 works as expected Or you can use iris[iris$Species==virginica, c(1,3)] to get same result without using subset. Regards Petr hear SUBJECTS1$SUBJECTSID vector contains nearly 65 values the problem is after comparing and subsetting its not giving all the values related to that instead its giving randam values and giving warning that: Warning message: In SUBJECTSID == SUBJECTS1$SUBJECTSID : longer object length is not a multiple of shorter object length can any one suggest what I can do to retreave all the related data of subset and store in one object thanks in advance regards; kiran [[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] ThinkCell type waterfall charts in R?
Hi all, with PowerPoint and ThinkCell one can draw something they call waterfall chart and it looks like this: http://www.think-cell.com/products/images/waterfall.gif I found discussions on waterfall charts in the archive of this mailinglist, but unfortunately they looked totally different. Other names for this type of plot seem to be bridge chart, cascade chart, stair case chart, etc. but neither of them brought successful results. So I decided to ask you directly on the list. Does anyone have an idea on how I could plot this type of chart in R? Thanks a lot Kerstin __ 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] ThinkCell type waterfall charts in R?
Kerstin wrote: Hi all, with PowerPoint and ThinkCell one can draw something they call waterfall chart and it looks like this: http://www.think-cell.com/products/images/waterfall.gif I found discussions on waterfall charts in the archive of this mailinglist, but unfortunately they looked totally different. Other names for this type of plot seem to be bridge chart, cascade chart, stair case chart, etc. but neither of them brought successful results. So I decided to ask you directly on the list. Does anyone have an idea on how I could plot this type of chart in R? Well Kirsten, it's a real challenge trying to find something that you _can't_ plot in R. Perhaps if you sent some data to the mailing list and a description of how the various counts (?) are related to one another, some R-nut may reply with what you want. Jim __ 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] New York Times - R - article a fraud?
Or maybe by John Chambers as the central person for the development of S ... I'd be more interested in their opinions than another outrage! Hi Roland, The Trevor who Eugene Dalt is referring to is Trevor Hastie. Trevor was at ATT Bell Labs at the time and worked/has worked very closely with John Chambers. He is an inside man, and knows better than an any correspondent on this list (except for John Chambers himself) what he is talking about. Regards, Mark. Rau, Roland wrote: Hi, it seems to me that this article in the NYT started many discussions. Maybe I missed it but are there some responses to the article by Ihaka Gentleman? Or maybe by John Chambers as the central person for the development of S (hope I am not mistaken here)? I'd be more interested in their opinions than another outrage! posting. Thanks, Roland -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eugene dalt Sent: Tuesday, February 03, 2009 1:49 AM To: r-h...@stat.math.ethz.ch Subject: [R] New York Times - R - article a fraud? I worked on some ad data before and I found NYT article very biaised and not far from a fraud... Anyone knows if they got money from a - company - to play 'R'? Check out the title: R U Ready for R? Seems to me this title was stolen from XLSolutions www.xlsolutions-corp.com and they never mentioned XLSolutions in the article! They mentioned commercial Rnever mentioned R-PLUS (www.experience-rplus.com), nor RSTAT (http://random-technologies-llc.com). I attended Trevor's class and his comment on the article is alarming: -- - As a long time user of S, Splus and now R, I loved the article on R until I read the paragraph on how it all started. I quote: According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use. This is grossly ungenerous to the original inventors of the wonderful S language underlying the R system. -- - I think R community should report this fraudulent article to the NYT ed board. It's fraud, not journalism and someone has to say it! 1- They got money for itfine it's business as usual (unless someone knows someone and took some bribes). Yes... One company seems to appear many many times in the article... 2- It's a 'free' article, then it's rubish as usual. __ 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 mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance. __ 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/New-York-Times-R-article-a-fraud--tp21805301p21807068.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] New York Times - R - article a fraud?
... And perhaps I might also have added that one of the strong precepts of this list is that credit be given where credit is due. Without such acknowledgement, which of course is founded on a strong principle, the Open-source community is likely eventually to fall that on its face... Regards, Mark. Rau, Roland wrote: Hi, it seems to me that this article in the NYT started many discussions. Maybe I missed it but are there some responses to the article by Ihaka Gentleman? Or maybe by John Chambers as the central person for the development of S (hope I am not mistaken here)? I'd be more interested in their opinions than another outrage! posting. Thanks, Roland -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of eugene dalt Sent: Tuesday, February 03, 2009 1:49 AM To: r-h...@stat.math.ethz.ch Subject: [R] New York Times - R - article a fraud? I worked on some ad data before and I found NYT article very biaised and not far from a fraud... Anyone knows if they got money from a - company - to play 'R'? Check out the title: R U Ready for R? Seems to me this title was stolen from XLSolutions www.xlsolutions-corp.com and they never mentioned XLSolutions in the article! They mentioned commercial Rnever mentioned R-PLUS (www.experience-rplus.com), nor RSTAT (http://random-technologies-llc.com). I attended Trevor's class and his comment on the article is alarming: -- - As a long time user of S, Splus and now R, I loved the article on R until I read the paragraph on how it all started. I quote: According to them, the notion of devising something like R sprang up during a hallway conversation. They both wanted technology better suited for their statistics students, who needed to analyze data and produce graphical models of the information. Most comparable software had been designed by computer scientists and proved hard to use. This is grossly ungenerous to the original inventors of the wonderful S language underlying the R system. -- - I think R community should report this fraudulent article to the NYT ed board. It's fraud, not journalism and someone has to say it! 1- They got money for itfine it's business as usual (unless someone knows someone and took some bribes). Yes... One company seems to appear many many times in the article... 2- It's a 'free' article, then it's rubish as usual. __ 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 mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance. __ 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/New-York-Times-R-article-a-fraud--tp21805301p21807238.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] RCurl FTPUpload
Hello, I am trying to solve a problem but with no success for the past 4 days. I use the RCurl package with R 2.8.1, and when I try to use the function FTPUpload, it uploads the file but does not stop. It repeats the content of the file without stopping and the destination file keeps getting bigger and bigger. Here is the line that I use : ftpUpload(C:/Users/herve/Documents/Document1.txt, sftp:// .dedibox.fr/home/herve/Document1.txt, userpwd = herve:xx) Any idea why it does not work ? Cordially, Hervé [[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] sas.get under Linux
On Monday 02 February 2009, Frank E Harrell Jr wrote: [...] Stat/Transfer has a menu option to read the SAS format catalog but I haven't tried it. Been there, done that... didn't get the t-shirt though. I tried everything I believe, but with no avail. Thanks again, Adrian -- Adrian Dusa Romanian Social Data Archive 1, Schitu Magureanu Bd. 050025 Bucharest sector 5 Romania Tel.:+40 21 3126618 \ +40 21 3120210 / int.101 Fax: +40 21 3158391 [[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] plot multiple time series
Hi, I have a dataframe containing a date object in the first column and numeric data in two other columns, for a total of three columns. I would like to plot the 2 numeric data columns against the dates in one window. How do I do this? It is easy to do if only one data series is to be plotted against a set of dates, but two or more datasets seems to be harder. Note: I have daily data where weekends and holidays are left out, e.g. stock returns. Therefore, I prefer not to construct a new 'dates' vector. Thanks, S.A. [[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] How do I get my IT department to bless R?
Stavros Macrakis wrote: Perhaps rather than globally saying it is utter nonsense you would care to refute what you think is wrong about it? -s PS Tyrants? Wow, we are really dramatizing life at work now that was so much in the style of '/Windoze Sucks!!!' /[1] wants to show off, but no courage to be concrete. vQ [1] http://www.math.unb.ca/~rolf/ On Mon, Feb 2, 2009 at 3:14 PM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 2/02/2009, at 4:29 PM, Murray Cooper wrote: I was about to post a similar reply. Stavros's reply was very eloquent and should be taken to heart! I would just like to say that in my very humble opinion Stavros's reply was utter nonsense. It was the sort of excuse-making favoured by tyrants since time immemorial. cheers, Rolf Turner __ 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] Lattice histogram with vertical lines
On Tue, 3 Feb 2009, Petr PIKAL wrote: Hi r-help-boun...@r-project.org napsal dne 03.02.2009 09:20:25: David Scott d.scott at auckland.ac.nz writes: I would like to add some vertical lines to a lattice plot of histograms. What I am after is a lattice version of abline(v = 1234). The lattice histogram plot is just: histogram( ~ LTSE | approach, data = arrivals) As a little variation on the histogram docs example: histogram( ~ height | voice.part, data = singer, xlab = Height (inches), type = density, panel = function(x, ...) { panel.histogram(x, ...) panel.abline(v= 70) panel.mathdensity(dmath = dnorm, col = black, args = list(mean=mean(x),sd=sd(x))) } ) Or if you want add lines at different places in each panel use this function and set once =T addLine- function(a=NULL, b=NULL, v = NULL, h = NULL, ..., once=F) { tcL - trellis.currentLayout() k-0 for(i in 1:nrow(tcL)) for(j in 1:ncol(tcL)) if (tcL[i,j] 0) { k-k+1 trellis.focus(panel, j, i, highlight = FALSE) if (once) panel.abline(a=a[k], b=b[k], v=v[k], h=h[k], ...) else panel.abline(a=a, b=b, v=v, h=h, ...) trellis.unfocus() } } Regards Petr Thanks to all respondents, including the first one who answered my question privately, Sundar Dorai-Raj. Sundar's reply was very similar to Dieter's version above and worked for me. I haven't tried Petr's suggestion, but I had been thinking I probably do need to put different lines on different panels, so this was a nice bit of anticipation on his behalf David Scott _ David Scott Department of Statistics The University of Auckland, PB 92019 Auckland 1142,NEW ZEALAND Phone: +64 9 373 7599 ext 85055 Fax: +64 9 373 7018 Email: d.sc...@auckland.ac.nz Graduate Officer, Department of Statistics Director of Consulting, Department of Statistics __ 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] reading .odf spreadsheet into R
I don't know of an elegant solution - I store most of my data as csv files so it can be easily accessed by all sorts of software tools - but for small tasks you can can just copy it and then use read.table(clipboard) Sarah On Mon, Feb 2, 2009 at 10:34 PM, stephen sefick ssef...@gmail.com wrote: I have searched the archives and I did not find the answer to my question. Is there a way to read in a .odf spreadsheet without modification to a .csv file. I am analyzing my classes scores on their first exam, and would like to read the grade book in without converting it to .csv. thanks -- Stephen Sefick -- 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] Large file size while persisting rpart model to disk
On Tue, 3 Feb 2009, tan wrote: I am using rpart to build a model for later predictions. To save the prediction across restarts and share the data across nodes I have been using save to persist the result of rpart to a file and load it later. But the saved size was becoming unusually large (even with binary, compressed mode). The size was also proportional to the amount of data that was used to create the model. After tinkering a bit, I figured out that most of the size was because of the rpart$functions attribute. If I set it to NULL, the size seems to drop dramatically. It can be seen with the following lines of R code, where there is a difference, though it is small. The difference is more pronounced with large datasets. library(rpart) fit - rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) save(fit, file=fit1.sav) fit$functions - NULL save(fit, file=fit2.sav) What is the reason behind it? The functions themselves seem small, so where it all the bulk coming from? Their environments. -- 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] Problems in Recommending R
Adam D. I. Kramer-2 wrote: I respectfully disagree. In my repeated experience, I have seen colleagues in industry and university simply write R off as too difficult or not worth the effort based on purely cosmetic grounds, and then at my urging and after some instruction embrace R as being a fantastic piece of software. The reality of the situation is that before you read a book, you only have its cover to judge. Suggesting that people should read every book regardless of the cover does not make sense for people who have other things to do. I respectfully disagree with your disagreement :-) You don't just have the cover by which to judge a book you have reviews of the book too (unless of course its just been printed, but even then it quickly gets sent out to review which then appear in journals/papers/web-sites/etc.). As it is there are a lot of reviews which extol the virtues of R. If you're colleagues (or anyone else) ignores these in favour of the look of the web-site to determine whether they are to start trying out and using R then that is their loss. Adam D. I. Kramer-2 wrote: In the ecological context of open-source software, the cover or cosmetics of a software program, its documentation, and its support structure are actually quite correlated with overall ease of use, and if functionality is modeled as the factorial interaction of information produced with the amount of time it takes to produce the information, then functionality correlates with ease of use, and so the appearance of the webpage is not a triviality. Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Neil -- View this message in context: http://www.nabble.com/Problems-in-Recommending-R-tp21783299p21808549.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] problem with subsetting in compating one column with a vector
Do you really want to use '==' ? How about '%in%', as in findings1-subset(findings,SUBJECTSID %in% ==SUBJECTS1$SUBJECTSID, select=c(SUBJECTSID,ORGNUMRES)) David Freedman dvkirankumar wrote: Hi all, I got one problem withsubset()function hear i executed: findings1-subset(findings,SUBJECTSID==SUBJECTS1$SUBJECTSID,select=c(SUBJECTSID,ORGNUMRES)) hear SUBJECTS1$SUBJECTSID vector contains nearly 65 values the problem is after comparing and subsetting its not giving all the values related to that instead its giving randam values and giving warning that: Warning message: In SUBJECTSID == SUBJECTS1$SUBJECTSID : longer object length is not a multiple of shorter object length can any one suggest what I can do to retreave all the related data of subset and store in one object thanks in advance regards; kiran [[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. -- View this message in context: http://www.nabble.com/problem-with-subsetting-in-compating-one-column-with-a-vector-tp21805448p21808625.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] pairs() help - colour histograms on diagonal
Nathan S. Watson-Haigh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'd like to be able to colour histograms along the diagonal using the colours stored in colnames(d): d blackbluebrowncyan 1 0.96405751 -0.02964390 -0.060147424 -0.06460070 2 -0.03614607 0.95475444 -0.152382053 -0.07767974 3 -0.07095613 -0.05884884 -0.061289399 -0.06445973 4 -0.03708223 -0.05997624 -0.054044275 -0.08291373 5 -0.08877190 -0.07193658 -0.078598617 -0.08892916 6 -0.09294377 -0.05563854 -0.051405213 -0.08442332 7 -0.08431200 -0.01657793 -0.119773022 -0.07364633 8 -0.06105875 -0.05311773 -0.062928495 -0.06982507 9 -0.05757523 -0.02589045 -0.102312333 -0.05616588 10 -0.05092343 -0.03935830 -0.062069716 -0.05402492 11 -0.08057353 -0.12690058 -0.004248301 -0.06850326 12 -0.08052613 -0.04962747 -0.098955086 -0.06496541 13 -0.07901151 -0.07587651 -0.077401999 0.96525294 14 -0.07187448 -0.15431262 0.952982852 -0.06471004 15 -0.07230232 -0.13704876 0.032573081 -0.05040565 So I'd like the top-left histogram on the diagonal to be coloured black, then the next one on the diagonal to be coloured blue etc. Is this possible? Normally information about what is being plotted isn't passed to the panel function, and attributes of the columns are stripped off before passing, so this isn't easy. If you want to do some ugly programming, you can look up the variable i in the sys.frame(2) environment; that will be the column number. While you're at it, you might as well get the data too: it's called x there. For example, d - data.frame(black=rnorm(100), blue=rnorm(100), brown=rnorm(100), cyan=rnorm(100)) panel.hist - function(x, ...) { # get some graphical parameter settings, and reset them on exit usr - par(usr) on.exit(par(usr)) par(usr = c(usr[1:2], 0, 1.5) ) # get a histogram of the data, but don't plot it - we just need to get some info from the histogram h - hist(x, plot = FALSE) breaks - h$breaks nB - length(breaks) y - h$counts; y - y/max(y) colnum - parent.frame(2)$i x - parent.frame(2)$x colour - colnames(x)[colnum] rect(breaks[-nB], 0, breaks[-1], y, col=colour, ...) } pairs(d, upper.panel=panel.smooth, diag.panel=panel.hist) Duncan Murdoch Cheers, Nathan - -- - Dr. Nathan S. Watson-Haigh OCE Post Doctoral Fellow CSIRO Livestock Industries Queensland Bioscience Precinct St Lucia, QLD 4067 Australia Tel: +61 (0)7 3214 2922 Fax: +61 (0)7 3214 2900 Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html - -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmHovYACgkQ9gTv6QYzVL5bUgCgw3EHQKS9WjO2AmtEks6x0Bh9 FLgAoIFpikJ903quFBaxQe5UVXAAbrnq =XRan -END PGP SIGNATURE- __ 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] Problems in Recommending R
2009/2/3 Neil Shephard nsheph...@gmail.com: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). What?!? Surely the most widely-used suite of software is Microsoft Windows, and that has a full-on bells, whistles, activeX, silverlight-powered web site. I'd say there was a direct relationship between website glossiness and amount of usage - more people use Notepad than Emacs. In which direction the causality (if any) works is an interesting question... I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). The open-source community should encourage contributions from beyond the world of the coder -- graphic designers, translators, writers and so on. Careful contributions from non-coders greatly enhance a project. Certainly style should not triumph over content but help to express the nature of the content. The R website still has a certain y2k feel about it, and although I'm sure we'd agree it would be wrong to make it all web 2.0 with rounded corners and a tag cloud, there's nothing wrong with refreshing a brand every five or six years. [ I did try redesigning the R logo for a cleaner look a few years ago - here it is on different backgrounds with a semi-ironic 3.0 flash: http://www.maths.lancs.ac.uk/~rowlings/Graphics/Logo/R/logos.png ] 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] Sweave
I strongly recommend using AucTeX for this. When inside a code chunk emacs behaves just like it does in ess mode, and when not in a code chunk emacs behaves like it usually does when editing LaTeX files in AucTeX. It's pretty great. As for your particular problem, I can't tell what's going on. If you send a minimal, reproducible example, I'll be happy to run it through Sweave and see what happens on my machine. -Ista From: Kjetil Halvorsen kjetilbrinchmannhalvor...@gmail.com To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Date: Mon, 2 Feb 2009 17:57:49 -0300 Subject: [R] Sweave I'm trying to (re)learn Sweave and run into some problems. I use now ubuntu (8.10), emacs + ess. Slowly getting upto speed on ess. I have a complete (hopefully) .Rnw file, but the resulting .tex will not compile. The file does not contain anything exotic, but it produces pdf figures, and that is where the problems come: library(tools) Sweave(varioCoo.Rnw) Writing to file varioCoo.tex Processing code chunks ... 1 : echo term verbatim (label=read) Loading required package: coda ... . . You can now run LaTeX on 'varioCoo.tex' Warning messages: ... don think this are important texi2dvi(varioCoo.tex, pdf=T) Error in texi2dvi(varioCoo.tex, pdf = T) : Running 'texi2dvi' on 'varioCoo.tex' failed. LaTeX errors: ! You can't use `macro parameter character #' in horizontal mode. argument ... sys...@active\string \endcsname ## l.111 bubble(NURE.orig, ppm, col = c(# 00ff0088, #00ff0088)) ! You can't use `macro parameter character #' in horizontal mode. argument ... sys...@active\string \endcsname ## l.111 ...NURE.orig, ppm, col = c(#00ff0088, # 00ff0088)) !pdfTeX error: pdflatex (file ./varioCoo-fig2.pdf): PDF inclusion: required pag e does not exist 0 == Fatal error occurred, no output PDF file produced! Sweave(varioCoo.Rnw) Writing to file varioCoo.tex Processing code chunks ... 1 : echo term verbatim (label=read) 2 : echo term verbatim (label=prep1) 3 : echo term verbatim (label=prep2) 4 : echo term verbatim eps pdf (label=fig2) 5 : echo term verbatim eps pdf (label=fig3) 6 : echo term verbatim eps pdf (label=fig4) You can now run LaTeX on 'varioCoo.tex' Warning message: In readLines(f[1]) : incomplete final line found on 'varioCoo.Rnw' texi2dvi(varioCoo.tex, pdf=T) Error in texi2dvi(varioCoo.tex, pdf = T) : Running 'texi2dvi' on 'varioCoo.tex' failed. LaTeX errors: ! You can't use `macro parameter character #' in horizontal mode. argument ... sys...@active\string \endcsname ## l.102 bubble(NURE.orig, ppm, col = c(# 00ff0088, #00ff0088)) ! You can't use `macro parameter character #' in horizontal mode. argument ... sys...@active\string \endcsname ## l.102 ...NURE.orig, ppm, col = c(#00ff0088, # 00ff0088)) !pdfTeX error: pdflatex (file ./varioCoo-fig2.pdf): PDF inclusion: required pag ---: well, list.files() say that file exists. e does not exist 0 == Fatal error occurred, no output PDF file produced! The other problem refered to above comes from this source lines: \begin{figure} \centering label=fig1,fig=TRUE,echo=TRUE= bubble(NURE.orig, ppm, col = c(#00ff0088, #00ff0088)) @ \caption{Contenido de uranio (ppm)} ??? Kjetil \end{figure} __ 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] Problems in Recommending R
Stavros Macrakis wrote: anti-alias the demonstration graphic. The current graphic makes R graphics seem (falsely!) to be very primitive. I'm afraid I don't know how to do the anti-aliasing myself. Simply re-plotting it in 2.8.1 built with Cairo support produces something better: http://etr-usa.com/tmp/swiss-cairo-281.png The text is antialiased, as are some of the graph lines. The dots in the largest plot aren't, though. Outputting to PDF and then scaling down does even better: http://etr-usa.com/tmp/swiss-from-pdf.png The command at the end to do this is: pdf(file=swiss.pdf, width=12, height=8) The R webmasters are welcome to use either of these in place of the current graphic, but it might be good to change the script to fix up some of the changes in the way the script is interpreted first. Fair warning: I won't be hosting these pictures for very long. Download 'em if you want 'em now. Replacing the fixed-width, typewriter-style font with something a bit more elegant might also be good The choice of fonts on the web is pretty limited, unless you want to get clever. I prefer to work with the few standard web fonts, building up improved styles relative to the defaults with CSS. It might be interesting to keep the current font, but experiment with letter spacing, for instance. Far more serious problems: - Use of frames. The usability problems of frames are well known, and are justified only in a few special cases. A content-heavy site like r-project.org is not one of them, if only because of the bookmarking issue. - Use of Times as the standard font. Times was commissioned by a newspaper, with a primary goal of reducing paper costs. Its creators succeeded by creating something compact and spindly, and thus uncommonly ugly and hard to read considering its popularity. It is marginally justifiable on paper, its design target. It should never be used on computer screens; at least, not until they get to 300 dpi or so. In general, use sans serif fonts on computer screens. There are rare exceptions, like Georgia (designed for PC screens from the start) and Courier (heavy slab serifs that come out okay on low-res screens). Look at the default fonts used on every OS, and every device with an LCD screen you own: they're all sans serif, aren't they? There's a reason for that... - HTML tables using the default 3D chiseled look. Nothing says 1995 better, except maybe blink tags, rainbow colored separator bars, and under construction graphics. __ 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] Automatic creation of columns in zoo object
Hello, everyone I have a question. Assume I have the following zoo object: me.la - structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465, 1421.25, 1561.5, 1590, 1568.75, 1623.5, 1612, 1573, 1587.5, 1530.5, 1530, 1509.75, 1494.5, 1479.5, 1435.75, 1573.5, 1601.5, 1580.25, 1635, 1623.5, 1584.5, 1599, 1541.75, 1541.5, 1521.5, 1506, 1491, 1447.25, 1585.5, 1613, 1591.75, 1646, 1634.5, 1595.5, 1610, 1552.75, 1552.75, 1532.75, 1517, 1502, 1458.25, 1600, 1627.5, 1606.5, 1660, 1649, 1609.75, 1624.25, 1567, 1567, 1547, 1531, 1516, 1472.25, 1612, 1639.5, 1618.25, 1671.5, 1661, 1621.5, 1635.75, 1578, 1578, 1558, 1542, 1527, 1483.5), .Dim = c(13L, 8L), index = structure(c(14245, 14246, 14249, 14250, 14251, 14252, 14253, 14256, 14257, 14258, 14259, 14260, 14263), format = m/d/y, origin = structure(c(1, 1, 1970), .Names = c(month, day, year)), class = c(dates, times)), class = zoo, .Dimnames = list(NULL, c(LA1 COMDTY, LA2 COMDTY, LA3 COMDTY, LA4 COMDTY, LA5 COMDTY, LA6 COMDTY, LA7 COMDTY, LA8 COMDTY))) I also have a following variable (used in RBloomberg) in my environment: me.la.tickers - c(LA1 Comdty, LA2 Comdty, LA3 Comdty, LA4 Comdty, LA5 Comdty, LA6 Comdty, LA7 Comdty, LA8 Comdty) What I need to do is to automate the following manual piece of code: me.la$LA2tr - 0 me.la$LA3tr - 0 me.la$LA4tr - 0 me.la$LA5tr - 0 me.la$LA6tr - 0 me.la$LA7tr - 0 me.la$LA8tr - 0 Basically, I need to automatically create new columns in futures object taking first part of names in me.la.tickers. I tried with paste() and assign() combination, but could not get. I could do the manual part, of course, it does not take much time, but: 1) I want to learn how to automatically create new columns in zoo objects 2) I have many more variables that have to be treated similarly (that is, I have me.lp with corresponding me.lp.tickers, me.qc with me.qc.tickers, etc. Then I have a bunch of variables starting with en, like en.co and en.cl, and corresponding ticker vectors, then ag variables and so variables, as well). I have all in all 24 zoo variables with 24 corresponding ticker vectors, and for each a corresponding ticker vector, and for each zoo variable I need to create 7 extra columns. That would take much time to do manually, and a lot of code. How would I do this automatically, please? Thank you in advance for your help! Regards, Sergey __ 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] Problems in Recommending R
On Tue, Feb 3, 2009 at 7:26 AM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: ... I'd say there was a direct relationship between website glossiness and amount of usage - more people use Notepad than Emacs. In which direction the causality (if any) works is an interesting question... How many people use Google to search? What about Yahoo? Which is glossier? I wouldn't quit using R (hah!), but I would be repelled by a glitzy website that requires script or plugins or anything beyond a standard web browser and an old computer to view. That said, there is an advantage to having an attractive, easy-to-navigate site. 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] Problems in Recommending R
friedrich.lei...@stat.uni-muenchen.de wrote: For technical reasons there are some conditions: the homepage is maintained via SVN like the R sources, so all should be plain HTML, no content management system etc. Consider using a static templating system, or a higher-level document language like DocBook's website variant; perhaps even Sweave? The idea is, you write your pages in a non-HTML format that gets compiled to HTML, just like building a program. Such tools let you do things like add a common navigation bar to all pages, so you can stop using frames for the nav bar, add common tags to all pages such as CSS includes, generate parts of the page programmatically, etc. I have sites using GTML and WPP for this: http://sunnyspot.org/wpp/ http://www2.lifl.fr/~beaufils/gtml/ Unfortunately, both are basically abandonware now. I keep using them because they still work, but if I were starting a new site design, I'd first look for better-maintained tools. One option would be to build something similar in R. A simple templating system might only take a few thousand LOC. R is flexible enough that the page source could be R code. Something like this: #!/usr/bin/Rscript require('rhtml') foo - 'bits' page - (' pPage body text goes here./p pSome [[foo]] of the page can be replaced, or you can call functions to calculate bits, such as to insert the current date: [[R(date())]]/p ') rhtml::generate(page, navbar = 'templates/navbar.R', header = 'templates/header.R') Call the script index.R, run it, and get index.html as output. A side benefit is that you could generate inline graphics with R. This would fix the antialiasing problem brought up above: as better graphics drawing code gets put into R, just rebuild the web site on a machine with the current version of R. __ 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] sub question
Gabor Grothendieck wrote: This comes from the all.vars function and would indicate a bug in that base R function. hush! a user bug, i presume? but indeed, all.vars(expression(foo(bar)())) # character(0) all.names(expression(foo(bar)())) # foo bar vQ f = function(a) function() paste(a, a, sep=) all.vars(~ fo(o)()) character(0) On Tue, Feb 3, 2009 at 8:24 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Peter Dalgaard wrote: Gabor Grothendieck wrote: On Sat, Jan 31, 2009 at 6:01 PM, Wacek Kusnierczyk th some additional boring pedantry wrt. ?gsubfn, which says: If 'replacement' is a formula instead of a function then a one line function is created whose body is the right hand side of the formula and whose arguments are the left hand side separated by '+' signs (or any other valid operator). The environment of the function is the environment of the formula. If the arguments are omitted then the free variables found on the right hand side are used in the order encountered. to my little mind, all of 'paste', 'rep', 'nchar', and 'x' in the example above are *free variables* on the right of the formula. you The first three are functions, not variables. They are still free variables, subject to the same rules of variable lookup. Wacek is right: The RHS is scanned recursively for objects of mode name _except_ when they appear as function names (i.e. if subexpression e is mode call, then forget e[[1]] and look at the arguments in as.list(e)[-1]. Not sure if this also happens if e[[1]] is not a name, e.g. in f(a)(b), do you get both a and b or just b?) an interesting point. the two calls to gsubfn below should, in this particular case, be equivalent: library(gsubfn) f = function(a) function(b) paste(a, b, sep=) gsubfn('o', ~ f('o')(o), 'foo') # f gsubfn('o', ~ f(o)('o'), 'foo') # the match seems to be ignored in the formula? the following fails, too: f = function(a) function() paste(a, a, sep=) gsubfn('o', ~ f(o)(), 'foo') # o won't capture the match this as well, though it's rather different: f = function() 'oo' gsubfn('o', ~ f(), 'foo') # really can't ignore the matched pattern if a formula is given? while an average statistician may never write such rubbish code, these are trivialized examples, and for a language advertised as one from the functional family this sort of code is not so unusual and it may be surprising that it fails. Can you clarify this. In what way was the match ignored? In the first case it added an o after each o. Were you expecting something different? __ 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] Problems in Recommending R
Barry Rowlingson wrote: 2009/2/3 Neil Shephard nsheph...@gmail.com: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). What?!? Surely the most widely-used suite of software is Microsoft Windows, and that has a full-on bells, whistles, activeX, silverlight-powered web site. My apologies I ommitted the 'open-source' caveat that Adam had written and I quoted in my response. Thus of all the _open-source_ software packages I have a strong suspicion that it is the GNU utilities that are the most widely used (since they are what makes up a funtional GNU/Linux installation, the Linux part simply refers to the code that forms the kernel and gets the hardware to communicate). Barry Rowlingson wrote: I'd say there was a direct relationship between website glossiness and amount of usage - more people use Notepad than Emacs. In which direction the causality (if any) works is an interesting question... Notepad doesn't have a web-site! (If your assertion is true it is the perfect vindication of the EU taking M$ to court over bundling IE with their OS ;-) Theres probably also a relationship between the glossiness of a website (or indeed software) and its quality/functionality. Usage is all well and good, but if you get the wrong answers out it doesn't matter how many people use it, they'll all be wrong! (viz. using Excel for statistics). Its a fine balance. Barry Rowlingson wrote: I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). The open-source community should encourage contributions from beyond the world of the coder -- graphic designers, translators, writers and so on. Careful contributions from non-coders greatly enhance a project. Certainly style should not triumph over content but help to express the nature of the content. The R website still has a certain y2k feel about it, and although I'm sure we'd agree it would be wrong to make it all web 2.0 with rounded corners and a tag cloud, there's nothing wrong with refreshing a brand every five or six years. The issue of revamping the web-site arises regularly on this discussion list. A few people have said they're willing to help (in this thread and others in the past), but little has come to fruition. Refreshing branding can work two ways though, sometimes the identity and image that has been built up over time is lost. The developers of R have focused on what they are good at, which is developing R. I get the impression that they are willing to embrace graphic designers, translators, writers and so on (with some caveats on how it is to be managed as pointed out by Friedrich), but no one appears to have stepped up to the oche yet. Neil -- View this message in context: http://www.nabble.com/Problems-in-Recommending-R-tp21783299p21810523.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] color and fontfamily in lattice
Hi, I am having some problems using bwplot(lattice) in my data. I want change some parameters: 1) Fontfamily to serif 2) The size of the font 3) Put it in a bold face 4) Change de color of the lines How can I do that?! Now, I am using this to plot my boxplot. dados - data.frame(varsep=as.factor(rep(1:2,10)),i=runif(20)) bwplot(dados[,'varsep']~dados[,'i'],xlab=names(dados)[2],ylab=names(dados)[1],panel =function(...){panel.grid(v = -1, h = 0);panel.bwplot(...)},font=2,fontfamily='serif') Thanks for any help on advance and sorry about my English. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 0 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] Automatic creation of columns in zoo object
Not sure why you need to have all these extra columns if they are only zero anyways. Could you not append them when you get data for them? Are these placeholders really of any value? At any rate its done using cbind or merge like this: library(zoo) library(chron) nms - sub(.Comdty, tr, me.la.tickers) zeromat - matrix(0, nrow(me.la), length(nms), dimnames = list(NULL, nms)) cbind(me.la, zeromat) In this case zeromat and me.la have the same dimensions so we could alternately reduce it to this slightly briefer code: zeromat - 0 * me.la colnames(zeromat) - sub(.Comdty, tr, me.la.tickers) cbind(me.la, zeromat) On Tue, Feb 3, 2009 at 8:44 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone I have a question. Assume I have the following zoo object: me.la - structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465, 1421.25, 1561.5, 1590, 1568.75, 1623.5, 1612, 1573, 1587.5, 1530.5, 1530, 1509.75, 1494.5, 1479.5, 1435.75, 1573.5, 1601.5, 1580.25, 1635, 1623.5, 1584.5, 1599, 1541.75, 1541.5, 1521.5, 1506, 1491, 1447.25, 1585.5, 1613, 1591.75, 1646, 1634.5, 1595.5, 1610, 1552.75, 1552.75, 1532.75, 1517, 1502, 1458.25, 1600, 1627.5, 1606.5, 1660, 1649, 1609.75, 1624.25, 1567, 1567, 1547, 1531, 1516, 1472.25, 1612, 1639.5, 1618.25, 1671.5, 1661, 1621.5, 1635.75, 1578, 1578, 1558, 1542, 1527, 1483.5), .Dim = c(13L, 8L), index = structure(c(14245, 14246, 14249, 14250, 14251, 14252, 14253, 14256, 14257, 14258, 14259, 14260, 14263), format = m/d/y, origin = structure(c(1, 1, 1970), .Names = c(month, day, year)), class = c(dates, times)), class = zoo, .Dimnames = list(NULL, c(LA1 COMDTY, LA2 COMDTY, LA3 COMDTY, LA4 COMDTY, LA5 COMDTY, LA6 COMDTY, LA7 COMDTY, LA8 COMDTY))) I also have a following variable (used in RBloomberg) in my environment: me.la.tickers - c(LA1 Comdty, LA2 Comdty, LA3 Comdty, LA4 Comdty, LA5 Comdty, LA6 Comdty, LA7 Comdty, LA8 Comdty) What I need to do is to automate the following manual piece of code: me.la$LA2tr - 0 me.la$LA3tr - 0 me.la$LA4tr - 0 me.la$LA5tr - 0 me.la$LA6tr - 0 me.la$LA7tr - 0 me.la$LA8tr - 0 Basically, I need to automatically create new columns in futures object taking first part of names in me.la.tickers. I tried with paste() and assign() combination, but could not get. I could do the manual part, of course, it does not take much time, but: 1) I want to learn how to automatically create new columns in zoo objects 2) I have many more variables that have to be treated similarly (that is, I have me.lp with corresponding me.lp.tickers, me.qc with me.qc.tickers, etc. Then I have a bunch of variables starting with en, like en.co and en.cl, and corresponding ticker vectors, then ag variables and so variables, as well). I have all in all 24 zoo variables with 24 corresponding ticker vectors, and for each a corresponding ticker vector, and for each zoo variable I need to create 7 extra columns. That would take much time to do manually, and a lot of code. How would I do this automatically, please? Thank you in advance for your help! Regards, Sergey __ 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] Automatic creation of columns in zoo object
Dear Gabor, Yes, these extra columns are of value as I later write code that fills in those columns row by row conditional on some event taking place, and when there is no event there should be zero in a particular cell. BIG thanks for the quick reply. I will try the code out right away! Kind Regards, Sergey On Tue, Feb 3, 2009 at 15:05, Gabor Grothendieck ggrothendi...@gmail.com wrote: Not sure why you need to have all these extra columns if they are only zero anyways. Could you not append them when you get data for them? Are these placeholders really of any value? At any rate its done using cbind or merge like this: library(zoo) library(chron) nms - sub(.Comdty, tr, me.la.tickers) zeromat - matrix(0, nrow(me.la), length(nms), dimnames = list(NULL, nms)) cbind(me.la, zeromat) In this case zeromat and me.la have the same dimensions so we could alternately reduce it to this slightly briefer code: zeromat - 0 * me.la colnames(zeromat) - sub(.Comdty, tr, me.la.tickers) cbind(me.la, zeromat) On Tue, Feb 3, 2009 at 8:44 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone I have a question. Assume I have the following zoo object: me.la - structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465, 1421.25, 1561.5, 1590, 1568.75, 1623.5, 1612, 1573, 1587.5, 1530.5, 1530, 1509.75, 1494.5, 1479.5, 1435.75, 1573.5, 1601.5, 1580.25, 1635, 1623.5, 1584.5, 1599, 1541.75, 1541.5, 1521.5, 1506, 1491, 1447.25, 1585.5, 1613, 1591.75, 1646, 1634.5, 1595.5, 1610, 1552.75, 1552.75, 1532.75, 1517, 1502, 1458.25, 1600, 1627.5, 1606.5, 1660, 1649, 1609.75, 1624.25, 1567, 1567, 1547, 1531, 1516, 1472.25, 1612, 1639.5, 1618.25, 1671.5, 1661, 1621.5, 1635.75, 1578, 1578, 1558, 1542, 1527, 1483.5), .Dim = c(13L, 8L), index = structure(c(14245, 14246, 14249, 14250, 14251, 14252, 14253, 14256, 14257, 14258, 14259, 14260, 14263), format = m/d/y, origin = structure(c(1, 1, 1970), .Names = c(month, day, year)), class = c(dates, times)), class = zoo, .Dimnames = list(NULL, c(LA1 COMDTY, LA2 COMDTY, LA3 COMDTY, LA4 COMDTY, LA5 COMDTY, LA6 COMDTY, LA7 COMDTY, LA8 COMDTY))) I also have a following variable (used in RBloomberg) in my environment: me.la.tickers - c(LA1 Comdty, LA2 Comdty, LA3 Comdty, LA4 Comdty, LA5 Comdty, LA6 Comdty, LA7 Comdty, LA8 Comdty) What I need to do is to automate the following manual piece of code: me.la$LA2tr - 0 me.la$LA3tr - 0 me.la$LA4tr - 0 me.la$LA5tr - 0 me.la$LA6tr - 0 me.la$LA7tr - 0 me.la$LA8tr - 0 Basically, I need to automatically create new columns in futures object taking first part of names in me.la.tickers. I tried with paste() and assign() combination, but could not get. I could do the manual part, of course, it does not take much time, but: 1) I want to learn how to automatically create new columns in zoo objects 2) I have many more variables that have to be treated similarly (that is, I have me.lp with corresponding me.lp.tickers, me.qc with me.qc.tickers, etc. Then I have a bunch of variables starting with en, like en.co and en.cl, and corresponding ticker vectors, then ag variables and so variables, as well). I have all in all 24 zoo variables with 24 corresponding ticker vectors, and for each a corresponding ticker vector, and for each zoo variable I need to create 7 extra columns. That would take much time to do manually, and a lot of code. How would I do this automatically, please? Thank you in advance for your help! Regards, Sergey __ 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. -- I'm not young enough to know everything. /Oscar Wilde Experience is one thing you can't get for nothing. /Oscar Wilde When you are finished changing, you're finished. /Benjamin Franklin Tell me and I forget, teach me and I remember, involve me and I learn. /Benjamin Franklin Luck is where preparation meets opportunity. /George Patten __ 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] axes
Hello there, Is there a functionality or command that generates axes in the shape of a capital Greek letter gamma (upside down L) ? I use these for making sediment profiles. I have read through help-lists, tried different things and asked several people but never got a satisfactory result. I've tried the following: xx - c(2,4,6,5.8,5,4,3,1.5,0, 0, 0, 0) yy - (0:-11) plot(NULL, NULL, ylab=depth (cm), xlim=c(0,8), ylim=c(-12,1), las=1, xaxt=n, bty=n, xlab=) axis(3) points(xx, yy, pch=19, col=2) mtext(3, text=concentration, line=2.5) Not bad, but a bit complicated for such a seemingly simple thing...also, the axes do not intersect, something I would like them to do as in the bty=l command. I hope anyone knows a more elegant solution... Francesc Montserrat Spatial Ecology department, NIOO-CEME Korringaweg 7 4401 NT Yerseke The Netherlands +31-(0)113-577470 [[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] Problem about SARMA model forcasting
Hello, Guys: I'm from China, my English is poor and I'm new to R. The first message I sent to R help meets some problems, so I send again. Hope that I can get useful suggestions from you warm-hearted guys. Thanks. I builded a multiplicative seasonal ARMA model to a series named cDownRange. And the order is (1,1)*(0,1)45 The regular AR=1; regular MA=1; seasonal AR=0; seasonal MA=1; seasonal period=45. I fitted the model in R and get the result as below: Call:arima(x = cDownRange, order = c(1, 0, 1), seasonal = list(order = c(0, 1, 1), period = 45)) Coefficients: ar1 ma1 sma1 0.7364 -0.5046 -0.9511 s.e.0.0458 0.0594 0.0130 When I use the predict command of this model in R, it gives the right forcasting. So I think the forcast formula of this SARMA model should be written as below: X(t)=ar1*X(t-1)-ma1*a(t-1)-sma1*a(t-45)+ma1*sma1*a(t-46) But when I use this forcast formula in Excel, it gives a totally different predict from R. And I don't know why? I guess the expression of the forcast formula of this SARMA(1,1)*(0,1)45 is wrong, but I don't know the right form. Can anybody help me with this?Thank, again! saji from Shanghai _ ÔõÑùÂò³µÆ±¸ü·½±ã£¿Î¢Èí´º½ÚËÑË÷£¬µÚһʱ¼äΪÄúÌṩ»ð³µÆ±ÐÅÏ¢£¡ [[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] Problems in Recommending R
Warren Young wrote: Far more serious problems: - Use of frames. The usability problems of frames are well known, and are justified only in a few special cases. A content-heavy site like r-project.org is not one of them, if only because of the bookmarking issue. the framing problem has been solved with the use of a few css elements years ago. using css may simplify the html (to the degree you don't even need html, it can be plain xml with tags denoting data, not formatting), and once fixed, make editing of the page much easier (because you don't need to navigate among that many formatting tags). some formatting can also be fixed by designing an xslt template to be run once when new content is uploaded. the page can still be static while cleanly separating the data and the formatting. - Use of Times as the standard font. Times was commissioned by a newspaper, with a primary goal of reducing paper costs. Its creators succeeded by creating something compact and spindly, and thus uncommonly ugly and hard to read considering its popularity. It is marginally justifiable on paper, its design target. It should never be used on computer screens; at least, not until they get to 300 dpi or so. In general, use sans serif fonts on computer screens. There are rare exceptions, like Georgia (designed for PC screens from the start) and Courier (heavy slab serifs that come out okay on low-res screens). Look at the default fonts used on every OS, and every device with an LCD screen you own: they're all sans serif, aren't they? There's a reason for that... indeed, though it's not really so grave an issue. it's easy to override fonts in your browser, and see the cran/r pages in sf by default. - HTML tables using the default 3D chiseled look. Nothing says 1995 better, except maybe blink tags, rainbow colored separator bars, and under construction graphics. maybe they do want to say '1995'? it would claim progress. by far the most often explicitly mentioned date in r help is 1988 (for 'the new s language'). 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.
Re: [R] Problems in Recommending R
Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Have you ever used the R website? To download the latest version for R for windows you have to: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) And then if you want to email the url of that page to someone else you have to jump through hoops because it's embedded in a frame. Hadley -- http://had.co.nz/ __ 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] Automatic creation of columns in zoo object
It works perfectly! Thank you, Gabor, for the quick solution and for letting me learn sub() function. Supreme! :-) Regards, Sergey On Tue, Feb 3, 2009 at 15:05, Gabor Grothendieck ggrothendi...@gmail.com wrote: Not sure why you need to have all these extra columns if they are only zero anyways. Could you not append them when you get data for them? Are these placeholders really of any value? At any rate its done using cbind or merge like this: library(zoo) library(chron) nms - sub(.Comdty, tr, me.la.tickers) zeromat - matrix(0, nrow(me.la), length(nms), dimnames = list(NULL, nms)) cbind(me.la, zeromat) In this case zeromat and me.la have the same dimensions so we could alternately reduce it to this slightly briefer code: zeromat - 0 * me.la colnames(zeromat) - sub(.Comdty, tr, me.la.tickers) cbind(me.la, zeromat) On Tue, Feb 3, 2009 at 8:44 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone I have a question. Assume I have the following zoo object: me.la - structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465, 1421.25, 1561.5, 1590, 1568.75, 1623.5, 1612, 1573, 1587.5, 1530.5, 1530, 1509.75, 1494.5, 1479.5, 1435.75, 1573.5, 1601.5, 1580.25, 1635, 1623.5, 1584.5, 1599, 1541.75, 1541.5, 1521.5, 1506, 1491, 1447.25, 1585.5, 1613, 1591.75, 1646, 1634.5, 1595.5, 1610, 1552.75, 1552.75, 1532.75, 1517, 1502, 1458.25, 1600, 1627.5, 1606.5, 1660, 1649, 1609.75, 1624.25, 1567, 1567, 1547, 1531, 1516, 1472.25, 1612, 1639.5, 1618.25, 1671.5, 1661, 1621.5, 1635.75, 1578, 1578, 1558, 1542, 1527, 1483.5), .Dim = c(13L, 8L), index = structure(c(14245, 14246, 14249, 14250, 14251, 14252, 14253, 14256, 14257, 14258, 14259, 14260, 14263), format = m/d/y, origin = structure(c(1, 1, 1970), .Names = c(month, day, year)), class = c(dates, times)), class = zoo, .Dimnames = list(NULL, c(LA1 COMDTY, LA2 COMDTY, LA3 COMDTY, LA4 COMDTY, LA5 COMDTY, LA6 COMDTY, LA7 COMDTY, LA8 COMDTY))) I also have a following variable (used in RBloomberg) in my environment: me.la.tickers - c(LA1 Comdty, LA2 Comdty, LA3 Comdty, LA4 Comdty, LA5 Comdty, LA6 Comdty, LA7 Comdty, LA8 Comdty) What I need to do is to automate the following manual piece of code: me.la$LA2tr - 0 me.la$LA3tr - 0 me.la$LA4tr - 0 me.la$LA5tr - 0 me.la$LA6tr - 0 me.la$LA7tr - 0 me.la$LA8tr - 0 Basically, I need to automatically create new columns in futures object taking first part of names in me.la.tickers. I tried with paste() and assign() combination, but could not get. I could do the manual part, of course, it does not take much time, but: 1) I want to learn how to automatically create new columns in zoo objects 2) I have many more variables that have to be treated similarly (that is, I have me.lp with corresponding me.lp.tickers, me.qc with me.qc.tickers, etc. Then I have a bunch of variables starting with en, like en.co and en.cl, and corresponding ticker vectors, then ag variables and so variables, as well). I have all in all 24 zoo variables with 24 corresponding ticker vectors, and for each a corresponding ticker vector, and for each zoo variable I need to create 7 extra columns. That would take much time to do manually, and a lot of code. How would I do this automatically, please? Thank you in advance for your help! Regards, Sergey __ 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. -- I'm not young enough to know everything. /Oscar Wilde Experience is one thing you can't get for nothing. /Oscar Wilde When you are finished changing, you're finished. /Benjamin Franklin Tell me and I forget, teach me and I remember, involve me and I learn. /Benjamin Franklin Luck is where preparation meets opportunity. /George Patten __ 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] Automatic creation of columns in zoo object
That's not really in the spirit of R. Normally one works with whole objects at a time. You might wish to rethink your entire approach to this. On Tue, Feb 3, 2009 at 9:11 AM, Sergey Goriatchev serg...@gmail.com wrote: Dear Gabor, Yes, these extra columns are of value as I later write code that fills in those columns row by row conditional on some event taking place, and when there is no event there should be zero in a particular cell. BIG thanks for the quick reply. I will try the code out right away! Kind Regards, Sergey On Tue, Feb 3, 2009 at 15:05, Gabor Grothendieck ggrothendi...@gmail.com wrote: Not sure why you need to have all these extra columns if they are only zero anyways. Could you not append them when you get data for them? Are these placeholders really of any value? At any rate its done using cbind or merge like this: library(zoo) library(chron) nms - sub(.Comdty, tr, me.la.tickers) zeromat - matrix(0, nrow(me.la), length(nms), dimnames = list(NULL, nms)) cbind(me.la, zeromat) In this case zeromat and me.la have the same dimensions so we could alternately reduce it to this slightly briefer code: zeromat - 0 * me.la colnames(zeromat) - sub(.Comdty, tr, me.la.tickers) cbind(me.la, zeromat) On Tue, Feb 3, 2009 at 8:44 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello, everyone I have a question. Assume I have the following zoo object: me.la - structure(c(1524.75, 1554.5, 1532.25, 1587.5, 1575.25, 1535.5, 1550, 1493.5, 1492.5, 1472.25, 1457.5, 1442.75, 1399, 1535.75, 1565.25, 1543.5, 1598.5, 1586.5, 1547, 1561.5, 1504.75, 1503.75, 1483.75, 1468.75, 1453.75, 1410, 1546.75, 1575.25, 1554, 1609, 1597.5, 1558.5, 1573, 1516.25, 1515.5, 1495, 1480, 1465, 1421.25, 1561.5, 1590, 1568.75, 1623.5, 1612, 1573, 1587.5, 1530.5, 1530, 1509.75, 1494.5, 1479.5, 1435.75, 1573.5, 1601.5, 1580.25, 1635, 1623.5, 1584.5, 1599, 1541.75, 1541.5, 1521.5, 1506, 1491, 1447.25, 1585.5, 1613, 1591.75, 1646, 1634.5, 1595.5, 1610, 1552.75, 1552.75, 1532.75, 1517, 1502, 1458.25, 1600, 1627.5, 1606.5, 1660, 1649, 1609.75, 1624.25, 1567, 1567, 1547, 1531, 1516, 1472.25, 1612, 1639.5, 1618.25, 1671.5, 1661, 1621.5, 1635.75, 1578, 1578, 1558, 1542, 1527, 1483.5), .Dim = c(13L, 8L), index = structure(c(14245, 14246, 14249, 14250, 14251, 14252, 14253, 14256, 14257, 14258, 14259, 14260, 14263), format = m/d/y, origin = structure(c(1, 1, 1970), .Names = c(month, day, year)), class = c(dates, times)), class = zoo, .Dimnames = list(NULL, c(LA1 COMDTY, LA2 COMDTY, LA3 COMDTY, LA4 COMDTY, LA5 COMDTY, LA6 COMDTY, LA7 COMDTY, LA8 COMDTY))) I also have a following variable (used in RBloomberg) in my environment: me.la.tickers - c(LA1 Comdty, LA2 Comdty, LA3 Comdty, LA4 Comdty, LA5 Comdty, LA6 Comdty, LA7 Comdty, LA8 Comdty) What I need to do is to automate the following manual piece of code: me.la$LA2tr - 0 me.la$LA3tr - 0 me.la$LA4tr - 0 me.la$LA5tr - 0 me.la$LA6tr - 0 me.la$LA7tr - 0 me.la$LA8tr - 0 Basically, I need to automatically create new columns in futures object taking first part of names in me.la.tickers. I tried with paste() and assign() combination, but could not get. I could do the manual part, of course, it does not take much time, but: 1) I want to learn how to automatically create new columns in zoo objects 2) I have many more variables that have to be treated similarly (that is, I have me.lp with corresponding me.lp.tickers, me.qc with me.qc.tickers, etc. Then I have a bunch of variables starting with en, like en.co and en.cl, and corresponding ticker vectors, then ag variables and so variables, as well). I have all in all 24 zoo variables with 24 corresponding ticker vectors, and for each a corresponding ticker vector, and for each zoo variable I need to create 7 extra columns. That would take much time to do manually, and a lot of code. How would I do this automatically, please? Thank you in advance for your help! Regards, Sergey __ 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. -- I'm not young enough to know everything. /Oscar Wilde Experience is one thing you can't get for nothing. /Oscar Wilde When you are finished changing, you're finished. /Benjamin Franklin Tell me and I forget, teach me and I remember, involve me and I learn. /Benjamin Franklin Luck is where preparation meets opportunity. /George Patten __ 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] Problems in Recommending R
On Tue, Feb 3, 2009 at 9:20 AM, hadley wickham h.wick...@gmail.com wrote: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Have you ever used the R website? To download the latest version for R for windows you have to: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. __ 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] Problems in Recommending R
1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. Wow, I'd never noticed that before! Hadley -- http://had.co.nz/ __ 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] Problems in Recommending R
Hi All, Before these things be set in stone, it should be noted that it would be a real mistake to have a miscalculated statistical object on R's Homepage. Imagine if SAS found out! Fact is, the manner in which the percentage contribution of each PC to the overall inertia is calculated in the code used to make the display graphic is wrong. I have been meaning to point this out to Eric Lecoutre for some time now, but just never got around to it. There simply wasn't an urgent need to do so, given other things that had to be done first. So, apologies to Eric for pointing it out here; what he presented was a very nice piece of work and it justly deserved top honours. ## % contribution calculated as [line 31 in plotacpclust()] pclperc=100*(pcr$sdev)/sum(pcr$sdev)## this is wrong ## should be calculated as pclperc=100*(pcr$sdev^2)/sum(pcr$sdev^2) ## Proof summary(pcr - princomp(USArrests, cor = TRUE)) Importance of components: Comp.1Comp.2Comp.3 Comp.4 Standard deviation 1.5748783 0.9948694 0.5971291 0.41644938 Proportion of Variance 0.6200604 0.2474413 0.0891408 0.04335752 Cumulative Proportion 0.6200604 0.8675017 0.9566425 1. 100*(pcr$sdev)/sum(pcr$sdev) Comp.1 Comp.2 Comp.3 Comp.4 43.95018 27.76385 16.66410 11.62187 100*(pcr$sdev^2)/sum(pcr$sdev^2) Comp.1Comp.2Comp.3Comp.4 62.006039 24.744129 8.914080 4.335752 100*(pcr$sdev^2)[1]/sum(pcr$sdev^2) + 100*(pcr$sdev^2)[2]/sum(pcr$sdev^2) 86.75017 ## or using ade4 library(ade4) pcr - dudi.pca(USArrests, scannf=F, nf=4) inertia.dudi(pcr) Regards, Mark. Warren Young wrote: Stavros Macrakis wrote: anti-alias the demonstration graphic. The current graphic makes R graphics seem (falsely!) to be very primitive. I'm afraid I don't know how to do the anti-aliasing myself. Simply re-plotting it in 2.8.1 built with Cairo support produces something better: http://etr-usa.com/tmp/swiss-cairo-281.png The text is antialiased, as are some of the graph lines. The dots in the largest plot aren't, though. Outputting to PDF and then scaling down does even better: http://etr-usa.com/tmp/swiss-from-pdf.png The command at the end to do this is: pdf(file=swiss.pdf, width=12, height=8) The R webmasters are welcome to use either of these in place of the current graphic, but it might be good to change the script to fix up some of the changes in the way the script is interpreted first. Fair warning: I won't be hosting these pictures for very long. Download 'em if you want 'em now. Replacing the fixed-width, typewriter-style font with something a bit more elegant might also be good The choice of fonts on the web is pretty limited, unless you want to get clever. I prefer to work with the few standard web fonts, building up improved styles relative to the defaults with CSS. It might be interesting to keep the current font, but experiment with letter spacing, for instance. Far more serious problems: - Use of frames. The usability problems of frames are well known, and are justified only in a few special cases. A content-heavy site like r-project.org is not one of them, if only because of the bookmarking issue. - Use of Times as the standard font. Times was commissioned by a newspaper, with a primary goal of reducing paper costs. Its creators succeeded by creating something compact and spindly, and thus uncommonly ugly and hard to read considering its popularity. It is marginally justifiable on paper, its design target. It should never be used on computer screens; at least, not until they get to 300 dpi or so. In general, use sans serif fonts on computer screens. There are rare exceptions, like Georgia (designed for PC screens from the start) and Courier (heavy slab serifs that come out okay on low-res screens). Look at the default fonts used on every OS, and every device with an LCD screen you own: they're all sans serif, aren't they? There's a reason for that... - HTML tables using the default 3D chiseled look. Nothing says 1995 better, except maybe blink tags, rainbow colored separator bars, and under construction graphics. __ 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/Problems-in-Recommending-R-tp21783299p21811357.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] color and fontfamily in lattice
Try this: dados - data.frame(varsep = factor(rep(1:2,10)), i = runif(20)) library(lattice) font.settings - list( font = 2, cex = 2, fontfamily = serif) my.theme - list( box.umbrella = list(col = red), box.rectangle = list(col = purple), box.dot = list(col = blue, pch = 15), par.xlab.text = font.settings, par.ylab.text = font.settings, axis.text = font.settings) bwplot(varsep ~ i, dados, xlab = names(dados)[1], ylab = names(dados)[2], panel = function(...) { panel.grid(v = -1, h = 0) panel.bwplot(...) }, par.settings = my.theme) Type trellis.par.get() at the R command line to see other parameters you can change. To change the settings on all plots, you can remove the par.settings from the call to bwplot and simply use: trellis.par.set(theme = my.theme) HTH, --sundar 2009/2/3 Leandro Marino lean...@cesgranrio.org.br: Hi, I am having some problems using bwplot(lattice) in my data. I want change some parameters: 1) Fontfamily to serif 2) The size of the font 3) Put it in a bold face 4) Change de color of the lines How can I do that?! Now, I am using this to plot my boxplot. dados - data.frame(varsep=as.factor(rep(1:2,10)),i=runif(20)) bwplot(dados[,'varsep']~dados[,'i'],xlab=names(dados)[2],ylab=names(dados)[1],panel =function(...){panel.grid(v = -1, h = 0);panel.bwplot(...)},font=2,fontfamily='serif') Thanks for any help on advance and sorry about my English. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 0 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] axes
On 2/3/2009 9:18 AM, Montserrat, Francesc wrote: Hello there, Is there a functionality or command that generates axes in the shape of a capital Greek letter gamma (upside down L) ? I use these for making sediment profiles. I have read through help-lists, tried different things and asked several people but never got a satisfactory result. I've tried the following: xx - c(2,4,6,5.8,5,4,3,1.5,0, 0, 0, 0) yy - (0:-11) plot(NULL, NULL, ylab=depth (cm), xlim=c(0,8), ylim=c(-12,1), las=1, xaxt=n, bty=n, xlab=) axis(3) points(xx, yy, pch=19, col=2) mtext(3, text=concentration, line=2.5) Not bad, but a bit complicated for such a seemingly simple thing...also, the axes do not intersect, something I would like them to do as in the bty=l command. I hope anyone knows a more elegant solution... As far as I can see there's no reason not to plot the points in the original call to plot, but I don't think you can make it much more elegant other than writing a function to do it. You will probably need to use lines() or segments() to draw your Gamma axes right out to the corners, e.g. usr - par(usr) lines(usr[c(1,1,2)], usr[c(3,4,4)]) Duncan Murdoch Francesc Montserrat Spatial Ecology department, NIOO-CEME Korringaweg 7 4401 NT Yerseke The Netherlands +31-(0)113-577470 [[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] Problems in Recommending R
On 2/3/2009 9:32 AM, Gabor Grothendieck wrote: On Tue, Feb 3, 2009 at 9:20 AM, hadley wickham h.wick...@gmail.com wrote: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Have you ever used the R website? To download the latest version for R for windows you have to: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. It's not necessarily true that the patched version has milder bugs than the release version. The release has gone through an alpha/beta/rc test period (for whatever that's worth); the patched version hasn't necessarily been tested by anyone at all, though generally whoever fixes a bug does tests. It may also be harder to reproduce your research if you use patch builds: we don't save those, though we do try to save releases. But in any case, if you want to improve this, the source is available. In this case it's actually stored as part of the R sources, in https://svn.R-project.org/R/trunk/src/gnuwin32/cran/release.in Duncan Murdoch __ 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] Problems in Recommending R
hadley wickham wrote: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files Yes, this is of course much harder than avoiding to read the two bullet points labeled Getting Started 2. recognise that you need to click on an CRAN (what is a cran?) Clicking on the words CRAN mirror never comes to people's mind. I mean, it's not like the first line of the link explains the acronym, is it? 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) Of course the R project website is required to keep track of that. 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want Yes, there are two links so people will take the other one. 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. Wow, I'd never noticed that before! However, you are only supposed to need it if you are one of the exceedingly rare users who happens to be bitten by a bug that went undiscovered through several weeks of user testing. (Warning: The above may contain traces of sarcasm...) -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ 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] sub question
Peter Dalgaard wrote: Wacek Kusnierczyk wrote: Gabor Grothendieck wrote: This comes from the all.vars function and would indicate a bug in that base R function. hush! a user bug, i presume? but indeed, all.vars(expression(foo(bar)())) # character(0) all.names(expression(foo(bar)())) # foo bar Semantic quibble! Notice also that (same thing) all.vars(~ fo(o)(),functions=T) [1] ~ fo o The quibble is that functions=FALSE (default) can mean (a) do not descend recursively into the function part (first element) of a call (b) do descend, unless it is a name if it is a name, how would you descend? shouldn't the envisaged rule be like: when examining an operator expression, (a) descend if it is a compound expression (b) skip if it is a name then 'foo(bar)()' would decompose to: [('foo(bar)', '()'] [['foo', 'bar'], []] # by descent = ['bar'] # skip 'foo' where square brackets denote parse tree (first two lines) and the resulting list of names (last line). 'foo' skipped as being a simple name in an operator position. not sure about '~', i guess this is just an operator in the example above, so it's actually `~`(, foo(bar) ()) and the rule applies similarly. what it does is clearly (a), but arguably, (b) is what the documentation says. This can be resolved in two ways... Are there legitimate reasons to want behaviour (b)? That is, examples that would reasonably arise in practice. one legitimate reason is to keep the syntax/semantics clean (worship the god of boring pedantry). be this not enough, a practical example could certainly be found, though admittedly the above were made up for the discussion. 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] lapply and aggregate function
Dear list, I have two things I am struggling... # First set.seed(123) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), Feed = sample(letters[1:5], 20, replace=T), value=rnorm(20) ) # Mean for Light myD$meanLight - unlist( lapply( myD$Light, function(x) mean( myD$value[myD$Light == x]) ) ) # Mean for Feed myD$meanFeed - unlist( lapply( myD$Feed, function(x) mean( myD$value[myD$Feed == x]) ) ) myD # I would like to get a new Var meanLightFeed # holding the Group-Mean for each combination (eg. A:a = 0.821581) # by(myD$value, list(myD$Light, myD$Feed), mean)[[1]] # Second set.seed(321) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), value=rnorm(20) ) w1 - tapply(myD$value, myD$Light, mean) w1 # w1 # A B # 0.4753412 -0.2108387 myfun - function(x) (myD$value w1[x] myD$value w1[x] * 1.5) I would like to have a TRUE/FALSE-Variable depend on the constraint in myfun for each level in Light... As always - thanks for any help!! Patrick __ 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] reading .odf spreadsheet into R
If you do look at that you might be able to modify read.xls in gdata package. It uses perl code to read xls files so you would already have the infrastructure R code all set out for you. On Tue, Feb 3, 2009 at 10:09 AM, Marc Schwartz marc_schwa...@comcast.net wrote: I have not used it, but if you are at all comfortable with Perl, you might want to look at the Spreadsheet::Read module: http://search.cpan.org/~HMBRAND/Spreadsheet-Read/Read.pm There is a wiki article here: http://howto.wikia.com/wiki/Howto_read_OpenOffice_OpenDocument_spreadsheets_in_Perl that provides an overview of Perl options to read ODS files. HTH, Marc Schwartz on 02/03/2009 08:18 AM Erich Neuwirth wrote: Using unoconv (http://dag.wieers.com/rpm/packages/unoconv/) might be a solution. stephen sefick wrote: I have searched the archives and I did not find the answer to my question. Is there a way to read in a .odf spreadsheet without modification to a .csv file. I am analyzing my classes scores on their first exam, and would like to read the grade book in without converting it to .csv. 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] lapply and aggregate function
You might want to look at the doBy package For (1), you could use summaryBy(value~Light+Feed,data=myD, FUN=mean) and for (2), the transformBy function would be helpful David Freedman Patrick Hausmann wrote: Dear list, I have two things I am struggling... # First set.seed(123) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), Feed = sample(letters[1:5], 20, replace=T), value=rnorm(20) ) # Mean for Light myD$meanLight - unlist( lapply( myD$Light, function(x) mean( myD$value[myD$Light == x]) ) ) # Mean for Feed myD$meanFeed - unlist( lapply( myD$Feed, function(x) mean( myD$value[myD$Feed == x]) ) ) myD # I would like to get a new Var meanLightFeed # holding the Group-Mean for each combination (eg. A:a = 0.821581) # by(myD$value, list(myD$Light, myD$Feed), mean)[[1]] # Second set.seed(321) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), value=rnorm(20) ) w1 - tapply(myD$value, myD$Light, mean) w1 # w1 # A B # 0.4753412 -0.2108387 myfun - function(x) (myD$value w1[x] myD$value w1[x] * 1.5) I would like to have a TRUE/FALSE-Variable depend on the constraint in myfun for each level in Light... As always - thanks for any help!! Patrick __ 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/lapply-and-aggregate-function-tp21811834p21812057.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] Problems in Recommending R
Neil Shephard wrote: Perhaps this is a deliberate design and serves as an intelligence test. If you can't navigate through to find the correct download you're really going to struggle getting started with R ;-D Yyeahhh...look how much that sort of stance has helped the cause of Linux on the desktop. World domination has been a year or two away for the last 10 years. (Speaking as one who uses Linux every day, and used it as his main desktop at home for many years before switching to OS X.) It's easy to pick apart the 6-step process posted above point by point, but the main thing to realize is that there really is no good technical reason why there have to be 6 decision points between arriving at the home page and getting an installable package. Take a look at how, say, getfirefox.com works. The download button is the biggest thing on the home page, impossible to miss. The site detects what platform you're on, and sets up the button to download that platform's latest version. No doubt they're using a CDN or mirror system on the back end, but detection of geographical location is done automatically based on client IP, not bothering the user. I think that's the earlier poster's main point: this can be a one-click process. Why make the human tell the computer things it already knows? __ 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] South West\Wales User Group
Hello R users, I've come to the conclusion there are no R user groups in the South West and Wales area (UK), i.e. somewhere where regular users of R can simply meet up, discuss R problems, new R technologies, etc on a social level. If there are such groups, could someone please post the information? If not, I'm thinking of setting up such a group. Would anyone in these areas be interested? Best wishes, Richard Weeks Richard Weeks mangosolutions data analysis that delivers Mail: rwe...@mango-solutions.com T: +44 (0)1249 767700 F: +44 (0)1249 767707 M: +44 (0)7500 040365 Unit 2 Greenways Business Park Bellinger Close Chippenham Wilts SN15 1BN UK [[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] OT: Reference for SIC/BIC
Generally smart people, I need a recent reference for using the Schwarz/Bayesian information criterion for model fitting in a frequentist stepwise regression. Joe [[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] Problems in Recommending R
Having listened to the complains I would like to say that I disagree. I like the Cran web set up. Given the amount of material it contains it is relatively easy to find things. It would be helpful if one read some of the material such as the FAQ or the R for windows FAQ or even the descriptions opposite links such as base which appeared to cause problems. I am not in favour of the over bloated sites of many commercial companies. Have you ever tried to negotiate the microsoft site? Some things work well but those that don't are terrible. I think that the current team are doing a good job. The site caters for many operating systems with a multitude of users at various levels Best Regards John 2009/2/3 Neil Shephard nsheph...@gmail.com: hadley wrote: Have you ever used the R website? To download the latest version for R for windows you have to: No I don't use windows and install R via the package management system of my chosen distribution (http://www.gentoo.org/). That said I have installed from source in the past when starting out with GNU/Linux and using Slackware, and I _never_ had a problem finding the source tarball to download. Perhaps this is a deliberate design and serves as an intelligence test. If you can't navigate through to find the correct download you're really going to struggle getting started with R ;-D The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). hadley wrote: And then if you want to email the url of that page to someone else you have to jump through hoops because it's embedded in a frame. I'd hit 'Back' on my browser, then right-click on the link I want to send and select 'Copy Link Location' and paste it into an email. Neil -- View this message in context: http://www.nabble.com/Problems-in-Recommending-R-tp21783299p21811904.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. -- John C Frain Trinity College Dublin Dublin 2 Ireland www.tcd.ie/Economics/staff/frainj/home.html mailto:fra...@tcd.ie mailto:fra...@gmail.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] sub question
Wacek Kusnierczyk wrote: (a) do not descend recursively into the function part (first element) of a call (b) do descend, unless it is a name if it is a name, how would you descend? By calling a recursive function which has it as the argument. It's not a problem unless you want it to be (first you descend into the first element on a call, then realize that it is a name). There are essentially three possibilities (cutting some red tape): f - function(e) if (is.name(e)) print(e) else if(is.call(e)) invisible(lapply(e,f)) f(~ fo(o)()) `~` fo o f - function(e) if (is.name(e)) print(e) else if(is.call(e)) invisible(lapply(e[-1],f)) f(~ fo(o)()) f - function(e) if (is.name(e)) print(e) else if(is.call(e)) invisible( if(is.name(e[[1]])) lapply(e[-1],f) else lapply(e,f)) f(~ fo(o)()) o The first two are essentially the current all.names and all.vars. The third is the one that you seem to expect. Notice that it gets rather more complicated than the others. one legitimate reason is to keep the syntax/semantics clean (worship the god of boring pedantry). be this not enough, a practical example could certainly be found, though admittedly the above were made up for the discussion. But can you be sure that there is no legitimate reason for expecting the current behaviour? -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ 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] reading .odf spreadsheet into R
I have not used it, but if you are at all comfortable with Perl, you might want to look at the Spreadsheet::Read module: http://search.cpan.org/~HMBRAND/Spreadsheet-Read/Read.pm There is a wiki article here: http://howto.wikia.com/wiki/Howto_read_OpenOffice_OpenDocument_spreadsheets_in_Perl that provides an overview of Perl options to read ODS files. HTH, Marc Schwartz on 02/03/2009 08:18 AM Erich Neuwirth wrote: Using unoconv (http://dag.wieers.com/rpm/packages/unoconv/) might be a solution. stephen sefick wrote: I have searched the archives and I did not find the answer to my question. Is there a way to read in a .odf spreadsheet without modification to a .csv file. I am analyzing my classes scores on their first exam, and would like to read the grade book in without converting it to .csv. 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.
Re: [R] Problems in Recommending R
On Tue, Feb 3, 2009 at 9:03 AM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: hadley wickham wrote: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files Yes, this is of course much harder than avoiding to read the two bullet points labeled Getting Started You think people read text before clicking on links? ;) Next you'll be trying to persuade me that people read the R startup text. I certainly had never noticed that link - the wrong words are higlighted by the link - the important part of that sentence is download R, CRAN mirror is just an implementation detail. 2. recognise that you need to click on an CRAN (what is a cran?) Clicking on the words CRAN mirror never comes to people's mind. I mean, it's not like the first line of the link explains the acronym, is it? Which first line? You have to click on the link to find out what it means. 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) Of course the R project website is required to keep track of that. Well someone needs to. 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want Yes, there are two links so people will take the other one. Why would anyone ever click on contrib? Why not move the content of base to that directory and then provide a link to contrib? That would save one step in the process. 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. Wow, I'd never noticed that before! However, you are only supposed to need it if you are one of the exceedingly rare users who happens to be bitten by a bug that went undiscovered through several weeks of user testing. (Warning: The above may contain traces of sarcasm...) Ditto. Hadley -- http://had.co.nz/ __ 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] Problems in Recommending R
One of my colleagues is a interdisciplinary PhD in Design and Psychology and he has an in with a design school where we might be able to get students to take on the redesign of the website. He asks: In order to ensure efficient consumption of resources and maximize our return on investment, please provide potential designers with a direct point of contact (name, email, telephone number) so that they may request a project description and feedback. Obviously the redesign idea has been generated in a community thread, but if anyone from the R foundation can step up as such a contact person I will forward your info to my colleague who will then take the temperature of students at the design school. -- Mike Lawrence Graduate Student Department of Psychology Dalhousie University www.thatmike.com Looking to arrange a meeting? Check my public calendar: http://www.thatmike.com/mikes-public-calendar ~ Certainty is folly... I think. ~ __ 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] Problems in Recommending R
The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). Again, have you ever read the FAQ? It is 133 pages! Hadley -- http://had.co.nz/ __ 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] R-CPCA
Dear Ben Bolker, searching for a R code able to do the CPCA I found a message by you on https://stat.ethz.ch/. In that message you said you have something I am looking for. Would you share with me? I ma stuck with a commercial software (GOLPE) that is not developed anymore, therefore I'd like to try to use R for the calculations I need. Looking forware for a reply from you Rino -- ++++ || Dr. Rino Ragno || || Dip. di Chimica e Tecnologie del Farmaco || || Facolta' di Farmacia || || Universita' degli Studi di Roma Sapienza || || P.le Aldo Moro, 5 - 00185 - Roma/Italia|| || PO BOX 36 ROMA 62 || || Phone: || ||Office/Lab +39-06-49913937/152 || || Fax: || ||Dpt+39-06-491491|| ||Office +39-06-49913627 || || E-mail: rino.ra...@uniroma1.it || || WWW: http://www.rcmd.it|| ++++ __ 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] lapply and aggregate function
# Second set.seed(321) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), value=rnorm(20) ) w1 - tapply(myD$value, myD$Light, mean) w1 # w1 # A B # 0.4753412 -0.2108387 myfun - function(x) (myD$value w1[x] myD$value w1[x] * 1.5) I would like to have a TRUE/FALSE-Variable depend on the constraint in myfun for each level in Light... You could use ddply from the plyr package for this: install.packages(plyr) library(plyr) ddply(myD, .(Light), transform, constraint = value mean(value) value mean(value) * 1.5) This applies the transform function to each subset defined by Light, and then joins all the pieces back together in a single data frame. You can use a similar approach for the other parts: myD - ddply(myD, .(Light), transform, meanLight = mean(value)) myD - ddply(myD, .(Feed), transform, meanFeed = mean(value)) myD - ddply(myD, .(Feed, Light), transform, meanFeedLight = mean(value)) Hadley -- http://had.co.nz/ __ 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] R-CPCA
Rino Ragno rino.ragno at uniroma1.it writes: Dear Ben Bolker, searching for a R code able to do the CPCA I found a message by you on https://stat.ethz.ch/. In that message you said you have something I am looking for. Would you share with me? I ma stuck with a commercial software (GOLPE) that is not developed anymore, therefore I'd like to try to use R for the calculations I need. Looking forware for a reply from you Rino You've sent this e-mail to a public mailing list, not to me. If you send e-mail to bolker at ufl.edu, I can send you a copy of the package (not hosted on CRAN for the time being). As far as CPC goes, my package just provides a wrapper for Patrick Phillips' CPC code -- you might try searching for that instead. sincerely Ben Bolker __ 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] ANOVA in R
Hi, I'm using a repeated measures ANOVA in R using lme(). The SAS code would be: PROC MIXED DATA=[data set below]; CLASS pid treat period time seq; MODEL Y = seq period treat time treat*time; REPEATED time / SUBJECT=pid TYPE=cs;RUN, I donot have SAS, instead I have R and I would like to try the following:anova(lme(response ~ seq period treat time treat*time,random= ~1|SUB, correlation=corCompSymm())) Is this correct? Can I also write the model as Y_ijklt = m + a_l + b_k + c_j + d_t + (cd)_jt + u_ijklt Y_ijklt is the response variable due to pid i, treat j, period k, seq l, and time t. Thank you very much in advance for your help :) Samor [[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] Problems in Recommending R
hadley wrote: The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). Again, have you ever read the FAQ? It is 133 pages! 133 pages (when printed?) that is divivded up into nice sections with sensible, navigable headings so that I can quickly find the relevant information From r-project.org - R FAQ - R Basics - How Can R be Installed - Choose your OS all in 10 seconds. People can only have their hands held for so long (and I'm not for one minute insinuating that you need your hand holding, its a more general comment as the information is out there, it just requires it to be read and understood). Neil -- View this message in context: http://www.nabble.com/Problems-in-Recommending-R-tp21783299p21813384.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] Problems in Recommending R
Warren Young wrote: Yyeahhh...look how much that sort of stance has helped the cause of Linux on the desktop. World domination has been a year or two away for the last 10 years. (Speaking as one who uses Linux every day, and used it as his main desktop at home for many years before switching to OS X.) Linux on the desktop is more likely a goal of Ubuntu. The main aims of http://www.kernel.org/ is simply to support the hardware in an open manner. GNU was to develop a UNIX-like standards compliant operating system, not sure getting that onto the desktop of every computer was an aim. Anyway this is a tangent and mostly irrelevant. Warren Young wrote: I think that's the earlier poster's main point: this can be a one-click process. Why make the human tell the computer things it already knows? Because sometimes the human has a better idea as to what they want than the computer? Example - I've found it infuriating when I've wanted to download browser source code (as the distro I use compiles from source) for firefox and only been presented with pre-compiled binaries (if I'm browsing at home) or windows versions (if I'm at work), then wasting more time trying to find FTP mirrors where the most recent source tar-balls are available, and as I remember that took far longer than being able to choose what OS and version I wanted from a series of clearly written pages. Neil -- View this message in context: http://www.nabble.com/Problems-in-Recommending-R-tp21783299p21813695.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] Large file size while persisting rpart model to disk
Dear Prof. Ripley, Thanks for the quick reply. I do notice an environment... in the print output. I assume it is used to keep copies of the initial data used for the model. - Is it safe to assume that it would not affect any other functionality, apart from the usage of those particular functions? - Is there a better/recommended way of reducing the size? Thanks, Tan On Feb 3, 4:56 pm, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Tue, 3 Feb 2009, tan wrote: I am using rpart to build a model for later predictions. To save the prediction across restarts and share the data across nodes I have been using save to persist the result of rpart to a file and load it later. But the saved size was becoming unusually large (even with binary, compressed mode). The size was also proportional to the amount of data that was used to create the model. After tinkering a bit, I figured out that most of the size was because of the rpart$functions attribute. If I set it to NULL, the size seems to drop dramatically. It can be seen with the following lines of R code, where there is a difference, though it is small. The difference is more pronounced with large datasets. library(rpart) fit - rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) save(fit, file=fit1.sav) fit$functions - NULL save(fit, file=fit2.sav) What is the reason behind it? The functions themselves seem small, so where it all the bulk coming from? Their environments. -- 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, UK Fax: +44 1865 272595 __ 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.
Re: [R] Problems in Recommending R
Hadley wickham wrote: The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). Again, have you ever read the FAQ? It is 133 pages! This means you have not read them??? Time to start reading! Uwe Hadley __ 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] 5 Courses*** R/Splus Fundamentals R Advanced Programming: March - April 2009 at USA locations by XLSolutions Corp
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce our*** R/Splus Fundamentals and Programming Techniques and R Advanced Programming***courses at USA locations for March - April 2009. (1) R/Splus Fundamentals and Programming Techniques http://www.xlsolutions-corp.com/rplus.asp * New York City ** March 19-20, 2009 * San Francisco ** March 16-17, 2009 (2) R/Splus Advanced Programming http://www.xlsolutions-corp.com/rplus.asp * San Francisco ** April 27-28, 2009 * Boston ** April 22-23, 2009 * New York City ** April 20-21, 2009 Ask for group discount and reserve your seat Now - Earlybird Rates. Payment due after the class! Email Sue Turner: s...@xlsolutions-corp.com Phone: 206-686-1578 Please let us know if you and your colleagues are interested in this class to take advantage of group discount. Register now to secure your seat! Cheers, Elvis Miller, PhD Manager Training. XLSolutions Corporation 206 686 1578 www.xlsolutions-corp.com el...@xlsolutions-corp.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] R-CPCA
Ben Bolker wrote: Rino Ragno rino.ragno at uniroma1.it writes: Dear Ben Bolker, searching for a R code able to do the CPCA [...] For amusement, try googling that acronym... -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ 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] lapply and aggregate function
Have a look at cast() form the reshape package. library(reshape) set.seed(123) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), Feed = sample(letters[1:5], 20, replace=T), value=rnorm(20) ) cast(myD, Light ~ ., fun = mean) cast(myD, Feed ~ ., fun = mean) cast(myD, Light + Feed ~ ., fun = mean) cast(myD, Light ~ Feed, fun = mean) 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 Patrick Hausmann Verzonden: dinsdag 3 februari 2009 16:12 Aan: r-help@r-project.org Onderwerp: [R] lapply and aggregate function Dear list, I have two things I am struggling... # First set.seed(123) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), Feed = sample(letters[1:5], 20, replace=T), value=rnorm(20) ) # Mean for Light myD$meanLight - unlist( lapply( myD$Light, function(x) mean( myD$value[myD$Light == x]) ) ) # Mean for Feed myD$meanFeed - unlist( lapply( myD$Feed, function(x) mean( myD$value[myD$Feed == x]) ) ) myD # I would like to get a new Var meanLightFeed # holding the Group-Mean for each combination (eg. A:a = 0.821581) # by(myD$value, list(myD$Light, myD$Feed), mean)[[1]] # Second set.seed(321) myD - data.frame( Light = sample(LETTERS[1:2], 10, replace=T), value=rnorm(20) ) w1 - tapply(myD$value, myD$Light, mean) w1 # w1 # A B # 0.4753412 -0.2108387 myfun - function(x) (myD$value w1[x] myD$value w1[x] * 1.5) I would like to have a TRUE/FALSE-Variable depend on the constraint in myfun for each level in Light... As always - thanks for any help!! Patrick __ 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. Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. __ 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] Problems in Recommending R
Gabor Grothendieck wrote: On Tue, Feb 3, 2009 at 9:20 AM, hadley wickham h.wick...@gmail.com wrote: Again I'd disagree, perhaps the most widely used suite of software has a very simple and clean web-site with few bells and whistles, ditto for one of the most popular text-editors. I am of course referring to the suite of GNU utilities (http://www.gnu.org/) that make a working GNU/Linux distribution and Emacs (http://www.gnu.org/software/emacs/ ). I like the R web-site, its clean and simple, present key information prominently (manuals, docs, CRAN, RNew and mailing lists). Have you ever used the R website? To download the latest version for R for windows you have to: 1. avoid clicking on the R version 2.8.1 link - that takes you to a directory listing of strangely named files 2. recognise that you need to click on an CRAN (what is a cran?) 3. successfully select a mirror that is up-to-date (with no information about which mirrors are up-to-date) 4. click Windows (ok, this one is easy) 5. guess that base is the distribution that you want 6. phew, you're there (but don't follow the advice to download from a mirror near you or you'll be back at step 3) Its even more confusing than that because actually you're not there yet! You have to click on the unobtrusive patched link and then download that or you get the version with the bugs. ... while you generally prefer the new bugs. otherwise, when you report a problem, you're (sometimes kindly) asked to upgrade -- and here you go again. 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] how to rotate y-axis tick labels
Hello, I need advice on how to rotate the y-axis tick labels by 90 degree clockwise. This must be a question that has been asked frequently, but I did not find it in the archived R-help messages. Thanks, Hong [[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] Problem about SARMA model forcasting
Saji, This may help. Your model is (1,0,1)X(0,1,1)S giving difference polynomials nonseasonal (1,0,1) = (1-ar1*B) = (1-ma1*B) seasonal (0,1,1)S = (1-B**S)= (1-sma1*B**S) giving: (1-ar1*B)X(1-B**S) x_t = (1-ma1*B)X(1-sma1*B**S) a_t multiplying out: x_t - x_(t-S) - ar1*x_(t-1) + ar1*x_(t-S-1) = a_t - ma1*a_(t-1) - sma1*a_(t-S) + ma1*sma1*a_(t-S-1) or x_t = x_(t-S) + ar1*x_(t-1) - ar1*x_(t-S-1) + a_t - ma1*a_(t-1) - sma1*a_(t-S) + ma1*sma1*a_(t-S-1) Hopefully I've multiplied all the bits out correctly and I think R uses this (Box-Jenkins) form for ARIMA models. Gerard 刘人润 saji_...@hotmail .com To Sent by: r-help@r-project.org r-help-boun...@r- cc project.org Subject [R] Problem about SARMA model 03/02/2009 10:22 forcasting Hello, Guys: I'm from China, my English is poor and I'm new to R. The first message I sent to R help meets some problems, so I send again. Hope that I can get useful suggestions from you warm-hearted guys. Thanks. I builded a multiplicative seasonal ARMA model to a series named cDownRange. And the order is (1,1)*(0,1)45 The regular AR=1; regular MA=1; seasonal AR=0; seasonal MA=1; seasonal period=45. I fitted the model in R and get the result as below: Call:arima(x = cDownRange, order = c(1, 0, 1), seasonal = list(order = c(0, 1, 1), period = 45)) Coefficients: ar1 ma1 sma1 0.7364 -0.5046 -0.9511 s.e.0.0458 0.0594 0.0130 When I use the predict command of this model in R, it gives the right forcasting. So I think the forcast formula of this SARMA model should be written as below: X(t)=ar1*X(t-1)-ma1*a(t-1)-sma1*a(t-45)+ma1*sma1*a(t-46) But when I use this forcast formula in Excel, it gives a totally different predict from R. And I don't know why? I guess the expression of the forcast formula of this SARMA(1,1)*(0,1)45 is wrong, but I don't know the right form. Can anybody help me with this?Thank, again! saji from Shanghai _ ÔõÑùÂò³µÆ±¸ü·½±ã£¿Î¢Èí´º½ÚËÑË÷£¬µÚһʱ¼äΪÄúÌṩ»ð³µÆ±ÐÅÏ¢£¡ [[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. ** 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
Re: [R] how to rotate y-axis tick labels
on 02/03/2009 11:01 AM Hong Qin wrote: Hello, I need advice on how to rotate the y-axis tick labels by 90 degree clockwise. This must be a question that has been asked frequently, but I did not find it in the archived R-help messages. See ?par and take note of 'las': # Default 'las = 0' plot(1) plot(1, las = 1) plot(1, las = 2) plot(1, las = 3) HTH, Marc Schwartz __ 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 show variables used in lm function call?
Hello R users, I am new to R and am wondering if anyone can help me out with the following issue: I wrote a function to build ts models using different inputs, but when R displays the call for a model, I cannot tell which variables it is using because it shows the arguments instead of the real variables passed to the function. (e.g Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) --- not what I want to see lm(formula = dyn(Y ~ lag(Y, -1) + XVARY)) - this is what I want to see (see simplified version of the code and output below) Thanks in advance for any help!! options (scipen=999, digits=7) library(Hmisc) library(DAAG) library(car) library(MASS) library(nlme) library(dyn) library(zoo) tdata - ts(read.table(C:/R/testing/data.csv ,sep = ,,header=TRUE)) print(tdata) coeff - function(dep, indep) { mod- dyn$lm(dep ~ lag(dep, -1)+ indep) summ - summary(mod) res- list(COEF=summ)} out- coeff(tdata[ ,Y], tdata[ ,XVARY]); out #output# print(tdata) Time Series: Start = 1 End = 20 Frequency = 1 Unit Y XVARY K DWAY 11 3 2 4 50 22 5 3 9 50 33 611 22 50 44 8 4 72 55 911 112 66 1213 132 77 2325 122 88 2230 313 99 23 3 33 10 10 1921 21 32 11 11 3 2 4 34 12 12 5 3 94 13 13 611 224 14 14 8 4 74 15 15 911 114 16 16 1213 134 17 17 2325 124 18 18 2230 314 19 19 23 3 34 20 20 1921 215 coeff - function(dep, indep) { + +mod- dyn$lm(dep ~ lag(dep, -1)+ indep) +summ - summary(mod) +res- list(COEF=summ) } out - coeff(tdata[ ,Y], tdata[ ,XVARY]); out $COEF Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) Residuals: Min 1Q Median 3Q Max -10.7157 -2.5454 -0.2090 0.8359 7.3292 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept)2.6473 2.1952 1.206 0.24538 lag(dep, -1) 0.5506 0.1558 3.535 0.00275 ** indep 0.3033 0.1259 2.408 0.02845 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 4.643 on 16 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.6679, Adjusted R-squared: 0.6264 F-statistic: 16.09 on 2 and 16 DF, p-value: 0.0001479 -- View this message in context: http://www.nabble.com/How-to-show-variables-used-in--lm-function-call--tp21814443p21814443.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] Problems in Recommending R
How much time do you think is needed to read 133 pages of FAQ. Regards, Ajay www.decisionstats.com On Tue, Feb 3, 2009 at 10:04 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Hadley wickham wrote: The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). Again, have you ever read the FAQ? It is 133 pages! This means you have not read them??? Time to start reading! Uwe Hadley __ 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.
Re: [R] ThinkCell type waterfall charts in R?
Without knowing how your data is formatted or how you intend to link the information together, all we can do is reconsctruct the plot from scratch. Here is one way to do that (change whatever values you want to tweek the look): plot( c(1,10), c(0,95), type='n', axes=F, xlab='', ylab='', xlim=c(0,11), ylim=c(0,150) ) left - (1:10) - 0.3 right - (1:10) + 0.3 top - c(86,86, 86-18, 55, 55, 55-5, 55-5-8, 32, 32, 23) bottom - c(0, 86-18, 55, 0, 55-5, 55-5-8, 32, 0, 32-9, 0) vals - c(86, 18, 13, 55, 5, 8, 10, 32, 9, 23) val.y - (top+bottom)/2 val.y[ bottom==0 ] - top[ bottom==0 ] + 5 cols - c('#bfcad7', '#ff', '#ff', '#8094af', '#ff', '#ff', '#ff', '#405e88', '#ff', '#405e88') rect( left,bottom,right,top, col=cols ) text( 1:10, val.y, vals ) lines( c(0.5, 10.5), c(0,0), lwd=5, lend='round') segments( right[-10], top[-1], left[-1], top[-1], lty='dashed' ) axis(1, at=1:10, labels=c('Registered\nprojects', rep('',9)), tick=FALSE, cex.axis=.5) Now that you can see one way to reconstruct the plot, I would add that I think this particular plot is not the best way to convey the information (the first example was a complete failure). It looks more like a poorly laid out table than a useful plot, why not just arrange the data as a table (with the numbers lined up properly and grouped according to your information) rather than as a plot that is more difficult to read. -- 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 Kerstin Sent: Tuesday, February 03, 2009 3:31 AM To: Jim Lemon Cc: r-help@r-project.org Subject: Re: [R] ThinkCell type waterfall charts in R? Jim Lemon wrote: Kerstin wrote: Hi all, with PowerPoint and ThinkCell one can draw something they call waterfall chart and it looks like this: http://www.think-cell.com/products/images/waterfall.gif I found discussions on waterfall charts in the archive of this mailinglist, but unfortunately they looked totally different. Other names for this type of plot seem to be bridge chart, cascade chart, stair case chart, etc. but neither of them brought successful results. So I decided to ask you directly on the list. Does anyone have an idea on how I could plot this type of chart in R? Well Kirsten, it's a real challenge trying to find something that you _can't_ plot in R. Perhaps if you sent some data to the mailing list and a description of how the various counts (?) are related to one another, some R-nut may reply with what you want. Jim Thanks a lot for your quick reply. In the attached pdf you can see the chart I would like to draw with R. I could of course make my life easier and use the Power Point chart, but importing a ppt chart into Latex would not make me sleep very well, besides the fact that all other plots in my document will come from R and I don't want this one to look totally different... Cheers Kerstin __ 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 show variables used in lm function call?
Pick off the names in the first two lines of the function body and then paste them into a formula, converting to a real formula object and then make your call: mylm - function(dep, indep, env = parent.frame()) { depnm - deparse(substitute(dep)) indepnm - deparse(substitute(indep)) fo - sprintf(%s ~ lag(%s, -1) + %s, depnm, depnm, indepnm) fo - as.formula(fo, env = env) do.call(dyn$lm, list(fo)) } library(dyn) x - zoo(1:10) y - x*x mylm(y, x) On Tue, Feb 3, 2009 at 12:16 PM, Pele drdi...@yahoo.com wrote: Hello R users, I am new to R and am wondering if anyone can help me out with the following issue: I wrote a function to build ts models using different inputs, but when R displays the call for a model, I cannot tell which variables it is using because it shows the arguments instead of the real variables passed to the function. (e.g Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) --- not what I want to see lm(formula = dyn(Y ~ lag(Y, -1) + XVARY)) - this is what I want to see (see simplified version of the code and output below) Thanks in advance for any help!! options (scipen=999, digits=7) library(Hmisc) library(DAAG) library(car) library(MASS) library(nlme) library(dyn) library(zoo) tdata - ts(read.table(C:/R/testing/data.csv ,sep = ,,header=TRUE)) print(tdata) coeff - function(dep, indep) { mod- dyn$lm(dep ~ lag(dep, -1)+ indep) summ - summary(mod) res- list(COEF=summ)} out- coeff(tdata[ ,Y], tdata[ ,XVARY]); out #output# print(tdata) Time Series: Start = 1 End = 20 Frequency = 1 Unit Y XVARY K DWAY 11 3 2 4 50 22 5 3 9 50 33 611 22 50 44 8 4 72 55 911 112 66 1213 132 77 2325 122 88 2230 313 99 23 3 33 10 10 1921 21 32 11 11 3 2 4 34 12 12 5 3 94 13 13 611 224 14 14 8 4 74 15 15 911 114 16 16 1213 134 17 17 2325 124 18 18 2230 314 19 19 23 3 34 20 20 1921 215 coeff - function(dep, indep) { + +mod- dyn$lm(dep ~ lag(dep, -1)+ indep) +summ - summary(mod) +res- list(COEF=summ) } out - coeff(tdata[ ,Y], tdata[ ,XVARY]); out $COEF Call: lm(formula = dyn(dep ~ lag(dep, -1) + indep)) Residuals: Min 1Q Median 3Q Max -10.7157 -2.5454 -0.2090 0.8359 7.3292 Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept)2.6473 2.1952 1.206 0.24538 lag(dep, -1) 0.5506 0.1558 3.535 0.00275 ** indep 0.3033 0.1259 2.408 0.02845 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.643 on 16 degrees of freedom (2 observations deleted due to missingness) Multiple R-squared: 0.6679, Adjusted R-squared: 0.6264 F-statistic: 16.09 on 2 and 16 DF, p-value: 0.0001479 -- View this message in context: http://www.nabble.com/How-to-show-variables-used-in--lm-function-call--tp21814443p21814443.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] Problems in Recommending R
Ajay ohri wrote: How much time do you think is needed to read 133 pages of FAQ. About 132.5 / 133 more times longer than most people are wanting to spend. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Regards, Ajay www.decisionstats.com On Tue, Feb 3, 2009 at 10:04 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: Hadley wickham wrote: The most useful thing (and quite rightly so) on the front page is the link the the FAQ which should be the starting point for anyone looking at any new software, and answers/explains everything thats pertinent! (At least thats what I read first when I start using new software and have questions). Again, have you ever read the FAQ? It is 133 pages! This means you have not read them??? Time to start reading! Uwe Hadley __ 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-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] Beveridge Nelson Decomposition
AFAIK there is no function to automatically compute the BN decomposition from a univariate time series in R. However, it is easy to compute by brute force from the output of an arima model fit to your data. A more elegant way would be to put your model in state space form and use the technique described in Morley's 2002 Econometrics Letters paper. You could easily use the functions in the R package dlm for this. I show how to do this using S-PLUS in my paper http://faculty.washington.edu/ezivot/statespacesurvey.pdf and the examples can easily be translated into R. Eric Zivot Shruthi Jayaram wrote: Hi, Would anyone know if it is possible to run a Beveridge Nelson decomposition of a univariate time series object in R? I searched in the help files but didn't come across any potential methods. Thanks very much, Shruthi -- View this message in context: http://www.nabble.com/Beveridge-Nelson-Decomposition-tp21789452p21815077.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] SOM package:How to fine tune parameters in two steps?
Hi all:I am trying to fit a SOM which is usually carried out in two steps. At each step, different parameters (learning rate, neighbourhood and number of epochs) need to be used.The SOM package is based on SOM-PAK (http://www.cis.hut.fi/research/papers/som_tr96.ps.Z). In the HTML help different strategies seem to be correct though I cannot find out how to fine tune the parameters asociated to each of the two steps:1. In the HELP example the following appearsdata(yeast) yeast - yeast[, -c(1, 11)] yeast.f - filtering(yeast) yeast.f.n - normalize(yeast.f) foo - som(yeast.f.n, xdim=5, ydim=6) foo - som(yeast.f.n, xdim=5, ydim=6, topol=hexa, neigh=gaussian) plot(foo) As you may notice there are two different lines with foo-som(...)My question is as follows: Does this mean that the first line and associated attributes starting withfoo-som(..) corresponds exclusively to the 1st phase and the second line foo-som(..) corresponds to the second phase and associated attributes of the same SOM being fitted?2. There are two additional functions which seem to carry out the same task, namely 'som.init' and 'som.update' The second question is: Would we reach the same final SOM if the first lineinstead of foo-som(..)were foo-som.init(...)and the second foo-som(...) were foo-som.update(...) ? Could we fine tune the parameters for the fitting process in this way(first phase with som.init and second phase with som.update)?Thank youGabriel Ibarra-BerastegiUniversity of the Basque CountrySPAIN [[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] sub question
Wacek Kusnierczyk wrote: Gabor Grothendieck wrote: This comes from the all.vars function and would indicate a bug in that base R function. hush! a user bug, i presume? but indeed, all.vars(expression(foo(bar)())) # character(0) all.names(expression(foo(bar)())) # foo bar Semantic quibble! Notice also that (same thing) all.vars(~ fo(o)(),functions=T) [1] ~ fo o The quibble is that functions=FALSE (default) can mean (a) do not descend recursively into the function part (first element) of a call (b) do descend, unless it is a name what it does is clearly (a), but arguably, (b) is what the documentation says. This can be resolved in two ways... Are there legitimate reasons to want behaviour (b)? That is, examples that would reasonably arise in practice. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ 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] R installation in a multiple-user Windows environment
We're having some issues with installing R in a multiple user Windows environment (e.g. when a user installs a package, there are errors linked to attempting to install certain files into restricted directories). Is there a readme for how to install R properly for multiple users? Thanks! --j -- Jonathan A. Greenberg, PhD Postdoctoral Scholar Center for Spatial Technologies and Remote Sensing (CSTARS) University of California, Davis One Shields Avenue The Barn, Room 250N Davis, CA 95616 Cell: 415-794-5043 AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307 __ 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] sub question
Peter Dalgaard wrote: Gabor Grothendieck wrote: On Sat, Jan 31, 2009 at 6:01 PM, Wacek Kusnierczyk th some additional boring pedantry wrt. ?gsubfn, which says: If 'replacement' is a formula instead of a function then a one line function is created whose body is the right hand side of the formula and whose arguments are the left hand side separated by '+' signs (or any other valid operator). The environment of the function is the environment of the formula. If the arguments are omitted then the free variables found on the right hand side are used in the order encountered. to my little mind, all of 'paste', 'rep', 'nchar', and 'x' in the example above are *free variables* on the right of the formula. you The first three are functions, not variables. They are still free variables, subject to the same rules of variable lookup. Wacek is right: The RHS is scanned recursively for objects of mode name _except_ when they appear as function names (i.e. if subexpression e is mode call, then forget e[[1]] and look at the arguments in as.list(e)[-1]. Not sure if this also happens if e[[1]] is not a name, e.g. in f(a)(b), do you get both a and b or just b?) an interesting point. the two calls to gsubfn below should, in this particular case, be equivalent: library(gsubfn) f = function(a) function(b) paste(a, b, sep=) gsubfn('o', ~ f('o')(o), 'foo') # f gsubfn('o', ~ f(o)('o'), 'foo') # the match seems to be ignored in the formula? the following fails, too: f = function(a) function() paste(a, a, sep=) gsubfn('o', ~ f(o)(), 'foo') # o won't capture the match this as well, though it's rather different: f = function() 'oo' gsubfn('o', ~ f(), 'foo') # really can't ignore the matched pattern if a formula is given? while an average statistician may never write such rubbish code, these are trivialized examples, and for a language advertised as one from the functional family this sort of code is not so unusual and it may be surprising that it fails. 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] Large file size while persisting rpart model to disk
I am using rpart to build a model for later predictions. To save the prediction across restarts and share the data across nodes I have been using save to persist the result of rpart to a file and load it later. But the saved size was becoming unusually large (even with binary, compressed mode). The size was also proportional to the amount of data that was used to create the model. After tinkering a bit, I figured out that most of the size was because of the rpart$functions attribute. If I set it to NULL, the size seems to drop dramatically. It can be seen with the following lines of R code, where there is a difference, though it is small. The difference is more pronounced with large datasets. library(rpart) fit - rpart(Kyphosis ~ Age + Number + Start, data=kyphosis) save(fit, file=fit1.sav) fit$functions - NULL save(fit, file=fit2.sav) What is the reason behind it? The functions themselves seem small, so where it all the bulk coming from? Thanks, Tan __ 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] reading .odf spreadsheet into R
Using unoconv (http://dag.wieers.com/rpm/packages/unoconv/) might be a solution. stephen sefick wrote: I have searched the archives and I did not find the answer to my question. Is there a way to read in a .odf spreadsheet without modification to a .csv file. I am analyzing my classes scores on their first exam, and would like to read the grade book in without converting it to .csv. thanks No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.17/1931 - Release Date: 2/2/2009 7:21 PM -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 __ 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] ThinkCell type waterfall charts in R?
Jim Lemon wrote: Kerstin wrote: Hi all, with PowerPoint and ThinkCell one can draw something they call waterfall chart and it looks like this: http://www.think-cell.com/products/images/waterfall.gif I found discussions on waterfall charts in the archive of this mailinglist, but unfortunately they looked totally different. Other names for this type of plot seem to be bridge chart, cascade chart, stair case chart, etc. but neither of them brought successful results. So I decided to ask you directly on the list. Does anyone have an idea on how I could plot this type of chart in R? Well Kirsten, it's a real challenge trying to find something that you _can't_ plot in R. Perhaps if you sent some data to the mailing list and a description of how the various counts (?) are related to one another, some R-nut may reply with what you want. Jim Thanks a lot for your quick reply. In the attached pdf you can see the chart I would like to draw with R. I could of course make my life easier and use the Power Point chart, but importing a ppt chart into Latex would not make me sleep very well, besides the fact that all other plots in my document will come from R and I don't want this one to look totally different... Cheers Kerstin Waterfall.pdf Description: Adobe PDF document __ 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] Model (Y) from left-censored independant variable (s)
Hi all; I'm trying to model a response variable (Y) from one (and eventually more...) independant left-censored variable (X*) In other words, X* is a random variable with values 0 - inf. Thus, let c=0 X*= x if x= c X*= c if x c Does anyone knows a function or package in [R] enabling to model Y from a censored predictor X*? Thanks for your help! Étienne Étienne Boucher Stagiaire Post-Doctoral Institut national de la recherche scientifique Centre Eau-Terre-Environnement 490, de la Couronne, Québec (Québec) G1K 9A9 Tel: 418-654-3823 etienne.bouc...@ete.inrs.ca __ 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 do I get my IT department to bless R?
Stavros Macrakis wrote: Condescendingly assuming that the IT department is run by idiots whose decisions are ruled by emotional attachments (as one correspondent suggested), or that they are irrationally prejudiced against free/open source, and that it is obvious and irrefutable that you know better than them (as was implied by some correspondents), may make you feel better, but probably won't help much. I assume that I am that one correspondent. My longer post above was one-sided to drive a point. I suspect everyone here is a logically-leaning sort, who has more than once fallen into the trap of thinking that if you just present a logical argument, your interlocutor will have no choice but to come over to your side of the issue. This can work, but it's not all that common. A likelier path to success includes an element of emotional jujutsu. Something I neglected to touch on above is that we should also be aware of our own emotional tie-ups. Most of those of us here *like* R, and not entirely for rational reasons. Perhaps you enjoy the aesthetics of the language; maybe you think the default graph types look especially nice; maybe you think free software is the only ethical sort; maybe some of the people here are friends of yours. If someone tells us R is no good, those emotions can turn on us, and you get a typical ugly advocacy battle. On the other hand, our feelings about R and its community can give us a reason to develop and pursue an emotionally forceful argument, which can win the day where a purely rational one wouldn't. It takes a certain amount of charisma or backing force for this to work; emotion again. It also won't help much if you don't explain clearly and calmly *why* exactly you need to use R for your work. Certainly. Just don't rely wholly on rational reasons. Don't forget that you are trying to change a human organization, and that this is much harder than swapping two columns in an R matrix. Some companies will be more careful, wanting to vet any software that can open a TCP connection (which most non-trivial software systems, including both Excel and R, can). Well, yes, I suppose I can't argue that there are probably some companies that do actually do this. I can't prove otherwise. What is obvious from just with a quick look-around, though, is that the vast majority of organizations don't. If they did, it wouldn't have taken a decade to get from ActiveX to UAC. Even if the IT department *is* behaving irrationally, responding irrationally yourself probably won't help your cause. I never said you should pursue the cause irrationally. I just said you should never forget that those you're trying to convince are never wholly rational. (A wholly rational human being is actually a pretty scary thing, so thankfully rare.) If you pursue your campaign thinking your audience will respond to your questions with T's and F's, the only way you can succeed is if they were inclined to support you regardless. Otherwise, you are lost. By the way, another reading suggestion I kicked myself for leaving out: http://www.issurvivor.com/ http://weblog.infoworld.com/lewis/ Want to know how IT management thinks and how to work with them to effect change? Read Bob's blog and InfoWorld column. Some selections that are particularly on-point here: http://www.weblog.keepthejointrunning.com/wordpress/?p=1594 http://www.weblog.keepthejointrunning.com/wordpress/?p=1603 http://www.weblog.keepthejointrunning.com/wordpress/?p=1623 http://www.weblog.keepthejointrunning.com/wordpress/?p=2552 http://www.weblog.keepthejointrunning.com/wordpress/?p=2691 __ 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] sub question
This comes from the all.vars function and would indicate a bug in that base R function. f = function(a) function() paste(a, a, sep=) all.vars(~ fo(o)()) character(0) On Tue, Feb 3, 2009 at 8:24 AM, Wacek Kusnierczyk waclaw.marcin.kusnierc...@idi.ntnu.no wrote: Peter Dalgaard wrote: Gabor Grothendieck wrote: On Sat, Jan 31, 2009 at 6:01 PM, Wacek Kusnierczyk th some additional boring pedantry wrt. ?gsubfn, which says: If 'replacement' is a formula instead of a function then a one line function is created whose body is the right hand side of the formula and whose arguments are the left hand side separated by '+' signs (or any other valid operator). The environment of the function is the environment of the formula. If the arguments are omitted then the free variables found on the right hand side are used in the order encountered. to my little mind, all of 'paste', 'rep', 'nchar', and 'x' in the example above are *free variables* on the right of the formula. you The first three are functions, not variables. They are still free variables, subject to the same rules of variable lookup. Wacek is right: The RHS is scanned recursively for objects of mode name _except_ when they appear as function names (i.e. if subexpression e is mode call, then forget e[[1]] and look at the arguments in as.list(e)[-1]. Not sure if this also happens if e[[1]] is not a name, e.g. in f(a)(b), do you get both a and b or just b?) an interesting point. the two calls to gsubfn below should, in this particular case, be equivalent: library(gsubfn) f = function(a) function(b) paste(a, b, sep=) gsubfn('o', ~ f('o')(o), 'foo') # f gsubfn('o', ~ f(o)('o'), 'foo') # the match seems to be ignored in the formula? the following fails, too: f = function(a) function() paste(a, a, sep=) gsubfn('o', ~ f(o)(), 'foo') # o won't capture the match this as well, though it's rather different: f = function() 'oo' gsubfn('o', ~ f(), 'foo') # really can't ignore the matched pattern if a formula is given? while an average statistician may never write such rubbish code, these are trivialized examples, and for a language advertised as one from the functional family this sort of code is not so unusual and it may be surprising that it fails. Can you clarify this. In what way was the match ignored? In the first case it added an o after each o. Were you expecting something different? __ 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] Multiple statements in tryCatch
Hi, tryCatch seems to be evaluating the all expressions wrapped in it before passing control to the error handling function. For example, the code below will try to evaluate results even though the call to odbcConnect fails. I was hoping that the mechanism would work in the same way as a C++ try catch structure and pass control to the catch... as soon as an exception is generated. Am I expecting too much or is there a way to tryCatch... multiple statements in R? tryCatch( { conn-odbcConnect(... results-sqlQuery(... } , error=function(err)myErrorHandler(... ) . This message is intended only for the use of the person(s) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any unauthorised use is strictly prohibited. If you are not the intended recipient, please contact the sender as soon as possible. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any opinions or advice contained in this Internet email are subject to the terms and conditions expressed in any applicable governing Marble Bar Asset Management LLP's terms and conditions of business or client agreement letter. Any comments or statements made herein do not necessarily reflect those of Marble Bar Asset Management LLP. Marble Bar Asset Management LLP is regulated and authorised by the FSA. [[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] non linear regression with nls
Hello, I'm a beginner with R and it's the first time I'm using the R-help list... I hope I'm in the right place, if not: Sorry!! I need to do non linear regressions on a data set which columns are: river.namePortata PTG.P PO4.P NT.NNH4.N NO3.N BOD5SiO2 I need to predict every variable (PTG, PO4, NT, ..., which are concentration of substances in water) starting from the Portata variable (which is the water flow) The functions that I'm using are: fz1-function(Portata, a, b){a+b/Portata} fz2-function(Portata, a, b){a*exp(b*Portata)} fz3-function(Portata, a, b, d, e){a+b/Portata+d*(Portata^e)} fz4-function(Portata, b, d){b*Portata^d} fz5-function(Portata, a, b, d){a+b*(Portata^d)} I've made a list of the functions with list(fz1, fz2, fz3, fz4, fz5) and the starting , lower and upper parameters for each function are: fz1: start=list(a=10, b=10), lower=list(a=0, b=0), upper=list(a=1000, b=1000) fz2: start=list(a=10, b=1), lower=list(a=0, b=0), upper=list(a=1000, b=1000) fz3: start=list(a=10, b=10, d=10, e=10), lower=list(a=0, b=0, d=0, e=-50), upper=list(a=1000, b=1000, d=1000, e=50) fz4: start=list (a=10, b=1), lower=list(a=0, b=-50), upper=list(a=1000, b=50) fz5: start=list(a=10, b=10, d=1), lower=list(a=0, b=0, d=-50), upper=list(a=1000, b=1000, d=50) so far i manage to do non linear regression one at a time that is, using one function for one river) using nls(), for example: r.NT.lav-nls(NT.N~ fz1(Portata, a,b), data=subset(dati,river.name==Laveggio), start=list(a=10, b=10), nls.control (maxiter=200), algorithm='port', trace=TRUE, na.action=na.omit, lower=list(a=0, b=0), upper=list(a=1000, b=1000)) and then I get the results with summary() and the graph using plotfit() but this will get extremly long since I have 12 rivers to analize for every variable and then compare the results, so I'd like to use a loop (cycle for??) but I can't figure out how it works. I've tried to look on the help page on ? Control (control flow) but I didn't understand it... Can somebody help me (give me a hint or an example of a loop) to automize the regression and save the results Please consider that my knowledge of computer programming is practically non-existent!! Thanks a lot! Laura F. __ 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] SAS language to R :interview
Dear List, Please find a frank interview with Phil Rack, creator of Bridge to R ( from both SAS and WPS interfaces). For those unaware of WPS- it is basically a SAS language compiler (read SAS code,writes SAS code,Reads and writes SAS datasets) ,priced at 660 $ a licence ( or estimated 10 times cheaper than Base SAS. The UK based WPC held, WPS doesnt have advanced statistical facilities like SAS /STAT , but that is solved with the Bridge to R . http://www.teamwpc.co.uk/home/ Please find extract of interview- Ajay- How does MineQuest intend to influence the analytical software paradigm? Phil- I think the role for MineQuest in the next few years is twofold. We'll keep offering services to banks and other financial service firms in the area of Operational Risk and SAS programming. The other area is to help these large financial service companies realize that they can save millions of dollars by moving their SAS Server licenses to WPS. This also allows the smaller businesses who have steered away from SAS software because of cost to begin using WPS and not take such a big financial hit. I find it exciting to think how this will also open the job market for the thousands of SAS programmers out there already. The BI battles are taking place on the desktop and Windows Servers and MineQuest has invested a lot of time and effort in creating macro libraries to help these organizations migrate their code to WPS and access R for advanced statistical capabilities. We believe that the bread and butter software for almost any financial organization in the BI realm ultimately revolves around the SAS language for reporting, summarization and disbursement of data and we plan to continue to serve that market. Read More..( and use comments section to comment) http://www.decisionstats.com/2009/02/interview-phil-rack/ __ 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] R: unable to install packages
Hi, I'm running R version 2.8.1 on Windows and I'm having quite a lot of trouble just to install package RODBC. When I run command install.packages(RODBC), the following error message appears: Warning: unable to access index for repository http://cran.pt.r-project.org/bin/windows/contrib/2.8 Then it stops and doesn't install anything. I've also tried downloading from several mirrors with no success. Is this normal? Am I doing anything wrong? Thanks, Joao Vaz __ 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] plot multiple time series
The quantmod package has graphics that are specific to securities. The zoo package has plot.zoo and xyplot.zoo . On Tue, Feb 3, 2009 at 6:30 AM, Shimrit Abraham shimrit.sabra...@gmail.com wrote: Hi, I have a dataframe containing a date object in the first column and numeric data in two other columns, for a total of three columns. I would like to plot the 2 numeric data columns against the dates in one window. How do I do this? It is easy to do if only one data series is to be plotted against a set of dates, but two or more datasets seems to be harder. Note: I have daily data where weekends and holidays are left out, e.g. stock returns. Therefore, I prefer not to construct a new 'dates' vector. Thanks, S.A. [[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.