[ESS] R window jumps to beginning (browse)
hi all, when browsing function, each step makes the R window jump to its start. How can I bring back the 'normal' behaviour of staying in place? -- Christian Hoffmann Rigiblickstrasse 15b CH-8915 Hausen am Albis Switzerland Telefon +41-(0)76-3650853 __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [ESS] When the R window opens, sometimes it is side-by-side with my .Rnw file. I want them one above the other. It seems unpredictable
> I'm using Vince Goulet's modified version of emacs 26.2 (build 1, > x86_64-w64-mingw32) of 2019-04-13 with ESS, on Windows 10. I use Sweave > and LaTeX, so I have my R code in .Rnw files. When I execute my first > line of R code, an R buffer opens of course. I prefer it to be below my > Rnw buffer. Sometimes it is. But other times the R buffer opens to the > side. It's unpredictable, which is disconcerting; I have not been able > to discern a pattern. How can I ensure that every time emacs/ESS opens > an R buffer, the emacs window is split top-and-bottom, rather than > side-by-side. hi Chris, I'm afraid that even after using Emacs for 30 years, I still find it unpredictable where buffers will appear. It has got much worse in recent years with widescreen monitors (on old terminals the splits used to be primarily above/below, rather than left/right). There are some variables you can investigate to help give Emacs some clues: ;; (setq split-height-threshold nil) ;; (setq split-width-threshold 75) and display-buffer-alist (info "(elisp)Window Parameters") In Emacs 28 there are a couple of new keybindings that help a bit: -- *** The key prefix 'C-x 4 1' displays next command buffer in the same window. It's bound to the command 'same-window-prefix' that requests the buffer of the next command to be displayed in the same window. *** The key prefix 'C-x 4 4' displays next command buffer in a new window. It's bound to the command 'other-window-prefix' that requests the buffer of the next command to be displayed in a new window. -- but still that does not help exactly with the direction of split. I've taken the view instead that Emacs is a bit like LaTeX -- where you can't always control where it will put figures/tables. Stephen __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
[ESS] When the R window opens, sometimes it is side-by-side with my .Rnw file. I want them one above the other. It seems unpredictable
I'm using Vince Goulet's modified version of emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13 with ESS, on Windows 10. I use Sweave and LaTeX, so I have my R code in .Rnw files. When I execute my first line of R code, an R buffer opens of course. I prefer it to be below my Rnw buffer. Sometimes it is. But other times the R buffer opens to the side. It's unpredictable, which is disconcerting; I have not been able to discern a pattern. How can I ensure that every time emacs/ESS opens an R buffer, the emacs window is split top-and-bottom, rather than side-by-side. Thanks. --Chris Ryan __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [R] [ESS] R window: Text is read only (: Another round :)
Dear Christian, to leave the read-only state, did you try C-x C-q in the mode line? Cheers, Albrecht -- Albrecht Kauffmann alkau...@fastmail.fm Am Mi, 20. Dez 2017, um 14:26, schrieb Christian: > Dear All > > Working along in R (Emacs {Aquamacs}, ESS ) usually I am getting a long > R buffer with many rows. To reduce its length, I used to select > backwards and delete those unnecessary rows. Now I cannot do that, only > C-k allows single lines to be deleted. the mode line says 'Text is > read-only *R*>'. Both R and ESS are up to date. > > Aquamacs 3.3 GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS > appkit-1344.72 Version 10.10.2 (Build 14C109)) > > R version 3.4.3 (2017-11-30) > Platform: x86_64-apple-darwin15.6.0 (64-bit) > Running under: macOS High Sierra 10.13.2 > > ess: 0171204.1404 > > This behaviour exists at the very start of R where I cannot evendo > anything in R. > > The *ESS* buffer says > > (inf-ess 3.0): prog=R, start-args=--no-readline , echoes=t > Making Process...Buf *R*, :Proc R, :Prog R > :Args= --no-readline > Start File=nil > (inferior-ess: waiting for process to start (before hook) > (inferior-ess 3): waiting for process after hook > > What additional information could be helpful to stop this strange behaviour? > > TIA C. > > > -- > Christian Hoffmann > Rigiblickstrasse 15b > CH-8915 Hausen am Albis > Switzerland > Telefon +41-(0)44-7640853 > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/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 -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/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] [ESS] R window: Text is read only (: Another round :)
Dear All Working along in R (Emacs {Aquamacs}, ESS ) usually I am getting a long R buffer with many rows. To reduce its length, I used to select backwards and delete those unnecessary rows. Now I cannot do that, only C-k allows single lines to be deleted. the mode line says 'Text is read-only *R*>'. Both R and ESS are up to date. Aquamacs 3.3 GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109)) R version 3.4.3 (2017-11-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.2 ess: 0171204.1404 This behaviour exists at the very start of R where I cannot evendo anything in R. The *ESS* buffer says (inf-ess 3.0): prog=R, start-args=--no-readline , echoes=t Making Process...Buf *R*, :Proc R, :Prog R :Args= --no-readline Start File=nil (inferior-ess: waiting for process to start (before hook) (inferior-ess 3): waiting for process after hook What additional information could be helpful to stop this strange behaviour? TIA C. -- Christian Hoffmann Rigiblickstrasse 15b CH-8915 Hausen am Albis Switzerland Telefon +41-(0)44-7640853 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/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: [ESS] R window: Text is read only
If you activate the debugger (M-x toggle-debug-on-error), does it show anything meaningful? >> On Wed, Sep 27 2017 09:47, Christian wrote: > Hi, after start with M-x R the R window behaves OK, allowing writing to. BUT, > after navigating in the help system, R refuses writing with "Text is read > only". This makes R unusable. I found no help on the net, so, please, give me > some hints. > This behaviour started bothering me out of the blue. Some mis-manipulation? > TIA C. __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
[ESS] R window: Text is read only
Hi, after start with M-x R the R window behaves OK, allowing writing to. BUT, after navigating in the help system, R refuses writing with "Text is read only". This makes R unusable. I found no help on the net, so, please, give me some hints. This behaviour started bothering me out of the blue. Some mis-manipulation? TIA C. -- Christian Hoffmann Rigiblickstrasse 15b CH-8915 Hausen am Albis Switzerland Telefon +41-(0)44-7640853 __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [R] Window on a vector
Yep I did some mistake while I was typing the example What I want is this one cbind(2^(0:(n-1))) and the problem is that at the last window this is going to explode are there will be less elements than what the window asks for. How should I deal with that? Regards Alex From: David Winsemius dwinsem...@comcast.net Cc: R help R-help@r-project.org Sent: Saturday, March 10, 2012 2:49 PM Subject: Re: [R] Window on a vector On Mar 10, 2012, at 7:44 AM, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. How I can do something like that in R? This will generate two series that are somewhat like your index specification. I say somewhat because you appear to have changed the indexing strategy in the middle. You start with 2^0. 2^1 and 2^2 as you begin but then switch to 2^3+1, and 2^4+1. n=20 cbind(2^(0:(n-1)), 2^(1:n)-1) You can decide what to use for n with logic like: which.max(20 = 2^(1:10) ) Then you can use sapply or mapply. Alex [[alternative HTML version deleted]] Please learn to post in plain text. -- David Winsemius, MD West Hartford, CT [[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] Window on a vector
It's not always true that going out of bounds in subscripting gives an error (as you seem to assert in your original post) x - 1:3 x[4] # No error and note that mean() has a na.rm argument. Perhaps you should construct a *reproducible* example of what you think will go wrong. Michael On Mon, Mar 12, 2012 at 11:22 AM, Alaios ala...@yahoo.com wrote: Yep I did some mistake while I was typing the example What I want is this one cbind(2^(0:(n-1))) and the problem is that at the last window this is going to explode are there will be less elements than what the window asks for. How should I deal with that? Regards Alex From: David Winsemius dwinsem...@comcast.net Cc: R help R-help@r-project.org Sent: Saturday, March 10, 2012 2:49 PM Subject: Re: [R] Window on a vector On Mar 10, 2012, at 7:44 AM, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. This doesn't seem true: x - 1:3 x[4] # Not an error How I can do something like that in R? This will generate two series that are somewhat like your index specification. I say somewhat because you appear to have changed the indexing strategy in the middle. You start with 2^0. 2^1 and 2^2 as you begin but then switch to 2^3+1, and 2^4+1. n=20 cbind(2^(0:(n-1)), 2^(1:n)-1) You can decide what to use for n with logic like: which.max(20 = 2^(1:10) ) Then you can use sapply or mapply. Alex [[alternative HTML version deleted]] Please learn to post in plain text. -- David Winsemius, MD West Hartford, CT [[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] Window on a vector
On Sat, Mar 10, 2012 at 04:44:00AM -0800, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. Hi. For computing the means, try something like the following myVector - 50:100 ilog - floor(log2(1:length(myVector))) tapply(myVector, ilog, FUN = mean) 012345 50.0 51.5 54.5 60.5 72.5 90.5 Compare with c(mean(myVector[1]), mean(myVector[2:3]), mean(myVector[4:7]), mean(myVector[8:15]), mean(myVector[16:31]), mean(myVector[32:51])) [1] 50.0 51.5 54.5 60.5 72.5 90.5 If you mean intervals, which end in a power of two, try ilog - ceiling(log2(1:length(myVector))) tapply(myVector, ilog, FUN = mean) 0123456 50.0 51.0 52.5 55.5 61.5 73.5 91.0 c(mean(myVector[1]), mean(myVector[2]), mean(myVector[3:4]), mean(myVector[5:8]), mean(myVector[9:16]), mean(myVector[17:32]), mean(myVector[33:51])) [1] 50.0 51.0 52.5 55.5 61.5 73.5 91.0 Hope this helps. Petr Savicky. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Window on a vector
You will find here a reprodusible example, and you will also see it exploding myData-seq(1:10) windowList-list(1,2,3,4) totalLength- length(myData) windowSize-30 for (i in 2:length(windowList)) { myMean-array() indexes-seq(1,totalLength,by=windowSize*windowList[[i]]) for (j in c(1,length(indexes))){ myMean[j]-mean(myData[indexes[j]:indexes[j+1]]) # Select windowSize number of elements # Then I will call a cdf and cast lines() } } as you can see on a given vector I want to calculating the mean value by taking each time different number of elements. The reason is I want to see how much increasing the number of samples affects the cdf distribution I would like to thank you in advance for your help B.R Alex From: R. Michael Weylandt michael.weyla...@gmail.com Cc: R help R-help@r-project.org Sent: Monday, March 12, 2012 4:35 PM Subject: Re: [R] Window on a vector It's not always true that going out of bounds in subscripting gives an error (as you seem to assert in your original post) x - 1:3 x[4] # No error and note that mean() has a na.rm argument. Perhaps you should construct a *reproducible* example of what you think will go wrong. Michael Yep I did some mistake while I was typing the example What I want is this one cbind(2^(0:(n-1))) and the problem is that at the last window this is going to explode are there will be less elements than what the window asks for. How should I deal with that? Regards Alex From: David Winsemius dwinsem...@comcast.net Cc: R help R-help@r-project.org Sent: Saturday, March 10, 2012 2:49 PM Subject: Re: [R] Window on a vector On Mar 10, 2012, at 7:44 AM, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. This doesn't seem true: x - 1:3 x[4] # Not an error How I can do something like that in R? This will generate two series that are somewhat like your index specification. I say somewhat because you appear to have changed the indexing strategy in the middle. You start with 2^0. 2^1 and 2^2 as you begin but then switch to 2^3+1, and 2^4+1. n=20 cbind(2^(0:(n-1)), 2^(1:n)-1) You can decide what to use for n with logic like: which.max(20 = 2^(1:10) ) Then you can use sapply or mapply. Alex [[alternative HTML version deleted]] Please learn to post in plain text. -- David Winsemius, MD West Hartford, CT [[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. [[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] Window on a vector
As the error message show, the problem isn't in the subscripting but rather in passing a NA to `:` If you try to implement Dr. Winsemius' method you should be fine. Also, send plain text email. Michael On Mon, Mar 12, 2012 at 11:58 AM, Alaios ala...@yahoo.com wrote: You will find here a reprodusible example, and you will also see it exploding myData-seq(1:10) windowList-list(1,2,3,4) totalLength- length(myData) windowSize-30 for (i in 2:length(windowList)) { myMean-array() indexes-seq(1,totalLength,by=windowSize*windowList[[i]]) for (j in c(1,length(indexes))){ myMean[j]-mean(myData[indexes[j]:indexes[j+1]]) # Select windowSize number of elements # Then I will call a cdf and cast lines() } } as you can see on a given vector I want to calculating the mean value by taking each time different number of elements. The reason is I want to see how much increasing the number of samples affects the cdf distribution I would like to thank you in advance for your help B.R Alex From: R. Michael Weylandt michael.weyla...@gmail.com To: Alaios ala...@yahoo.com Cc: R help R-help@r-project.org Sent: Monday, March 12, 2012 4:35 PM Subject: Re: [R] Window on a vector It's not always true that going out of bounds in subscripting gives an error (as you seem to assert in your original post) x - 1:3 x[4] # No error and note that mean() has a na.rm argument. Perhaps you should construct a *reproducible* example of what you think will go wrong. Michael On Mon, Mar 12, 2012 at 11:22 AM, Alaios ala...@yahoo.com wrote: Yep I did some mistake while I was typing the example What I want is this one cbind(2^(0:(n-1))) and the problem is that at the last window this is going to explode are there will be less elements than what the window asks for. How should I deal with that? Regards Alex From: David Winsemius dwinsem...@comcast.net Cc: R help R-help@r-project.org Sent: Saturday, March 10, 2012 2:49 PM Subject: Re: [R] Window on a vector On Mar 10, 2012, at 7:44 AM, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. This doesn't seem true: x - 1:3 x[4] # Not an error How I can do something like that in R? This will generate two series that are somewhat like your index specification. I say somewhat because you appear to have changed the indexing strategy in the middle. You start with 2^0. 2^1 and 2^2 as you begin but then switch to 2^3+1, and 2^4+1. n=20 cbind(2^(0:(n-1)), 2^(1:n)-1) You can decide what to use for n with logic like: which.max(20 = 2^(1:10) ) Then you can use sapply or mapply. Alex [[alternative HTML version deleted]] Please learn to post in plain text. -- David Winsemius, MD West Hartford, CT [[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] Window on a vector
Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. How I can do something like that in R? I would like to thank you in advance for your help B.R Alex [[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] Window on a vector
On Mar 10, 2012, at 7:44 AM, Alaios wrote: Dear all, I have a large vector (lets call it myVector) and I want to plot its value with the logic below yaxis-myVector[1] yaxis-c(xaxis,mean(myvector[2:3]) yaxis-c(xaxis,mean(myvector[4:8]) yaxisc(xaxis,mean(myvector[9:16]) yaxisc(xaxis,mean(myvector[17:32]) this has to stop when the new . yaxisc(xaxis,mean(myvector[1024:2048]) will not find the correspondent number of elements, either wise it will stop with an error. How I can do something like that in R? This will generate two series that are somewhat like your index specification. I say somewhat because you appear to have changed the indexing strategy in the middle. You start with 2^0. 2^1 and 2^2 as you begin but then switch to 2^3+1, and 2^4+1. n=20 cbind(2^(0:(n-1)), 2^(1:n)-1) You can decide what to use for n with logic like: which.max(20 = 2^(1:10) ) Then you can use sapply or mapply. Alex [[alternative HTML version deleted]] Please learn to post in plain text. -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] window manager interface commands for linux
On Mon, 28-Nov-2011 at 12:07PM +0100, Ana wrote: | How can i replicate this in Linux: | source(file.choose()) | As the Mac people used to say ungrammatically: Think Different. There are many ways of using Linux that can't be done in Windows and we know nothing of your setup, so it's not obvious what's most appropriate for you. Maybe something like the following: Start R from the directory you wish to use, preferably using ESS which will give you a separate Emacs window where you run your R commands. Otherwise open a second tab in your terminal window (which will automatically be the same directory). A Terminal window will thus be available where you can list your files, say with ls or ll. Paste the file name (using only the mouse) into your R command window. Takes lots of words to describe, but very easy to do. There are many variations on that idea. HTH -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) . Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window manager interface commands for linux
Le lundi 28 novembre 2011 à 12:07 +0100, Ana a écrit : How can i replicate this in Linux: source(file.choose()) I've tried source(tkgetOpenFile()) but with no luck Try this instead (it works here): source(tclvalue(tkgetOpenFile())) Cheers __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window manager interface commands for linux
Ana wrote: How can i replicate this in Linux: source(file.choose()) Hi Ana, There is probably some way to do this with a shell script, but I am unaware of it. If you have the marvelous Tcl-Tk scripting language on your Linux box, you could write something like this: #!/usr/bin/wish # sourceRfile a script to run an R command file # SelectFile - A module for selecting a filename from a directory # call SelectFile mask where 'mask' contains a mask or filename # default mask = * proc GetFileList filemask { set filelist [ glob -nocomplain $filemask ] return $filelist } proc StringElement cmplist { if { [ llength $cmplist ] 1 } { set cmpstring [ lindex $cmplist 0 ] set cmpchar [ lindex $cmplist 1 ] set stringlength [ string length $cmpstring ] set charlength [ string length $cmpchar ] set stringindex 0 while { $stringindex $stringlength } { set charindex 0 while { $charindex $charlength } { if { [ string index $cmpstring $stringindex ] ==\ [ string index $cmpchar $charindex ] } { return 1 } incr charindex } incr stringindex } } return 0 } proc SelectFile mask { global filename global done global rindex if { [ string length $mask ] == 0 } { set mask * } set path [ pwd ] set done 0 set filename set rindex 0 while { !$done } { frame .sff -bd 3 -relief raised label .sff.path -text $path entry .sff.name label .sff.filelabel -text Directories frame .sff.fileframe label .sff.dirlabel -text Files frame .sff.dirframe frame .sff.buttonframe listbox .sff.fileframe.flist -selectmode single \ -yscroll .sff.fileframe.yscroll set scrollbar .sff.fileframe.yscroll -relief sunken \ -command .sff.fileframe.flist yview listbox .sff.dirframe.dlist -selectmode single \ -yscroll .sff.dirframe.yscroll set scrollbar .sff.dirframe.yscroll -relief sunken \ -command .sff.dirframe.dlist yview set filelist [ GetFileList $mask ] lsort filelist set fileindex 0 foreach filein $filelist { if { [ file isfile $filein ] } { .sff.fileframe.flist insert $fileindex $filein incr fileindex } } set dirlist [ GetFileList * ] lsort dirlist set dlist [ list ] set dirindex 0 if { $path != / } { .sff.dirframe.dlist insert $dirindex .. incr dirindex } foreach dirin $dirlist { if { [ file isdirectory $dirin ] } { .sff.dirframe.dlist insert $dirindex $dirin incr dirindex } } bind .sff.fileframe.flist ButtonRelease-1 { .sff.name delete 0 end .sff.name insert 0 [ .sff.fileframe.flist get\ [ .sff.fileframe.flist curselection ] ] } button .sff.buttonframe.ok -text OK -command { if { [ llength [ .sff.dirframe.dlist curselection ] ] } { set filename [ .sff.dirframe.dlist get [ .sff.dirframe.dlist curselection ] ] } else { if { [ llength [ .sff.fileframe.flist curselection ] ] } { set filename [ .sff.fileframe.flist get [ .sff.fileframe.flist curselection ] ] } else { if { [ llength [ .sff.name get ] ] } { set filename [ .sff.name get ] } } } destroy .sff } button .sff.buttonframe.cancel -text Cancel -command { set rindex -1 set done 1 set filename destroy .sff } bind .sff.name Return { set filename [ .sff.name get ] destroy .sff } place .sff -relx 0.5 -rely 0.5 -anchor center -width 400\ -height 300 place .sff.path -relx 0.5 -rely 0.02 -anchor n place .sff.name -relx 0.5 -rely 0.12 -anchor n place .sff.filelabel -relx 0.05 -rely 0.22 place .sff.dirlabel -relx 0.55 -rely 0.22 place .sff.dirframe -relx 0.05 -rely 0.3 -relwidth 0.43\ -relheight 0.5 place .sff.fileframe -relx 0.55 -rely 0.3 -relwidth 0.43\ -relheight 0.5 place .sff.fileframe.flist -relx 0 -relwidth 0.85 -relheight 1 place .sff.fileframe.yscroll -relx 0.9 -rely 0.5\ -anchor center -relheight 1 place .sff.dirframe.dlist -relx 0 -relwidth 0.85 -relheight 1 place .sff.dirframe.yscroll -relx 0.9 -rely 0.5\ -anchor center -relheight 1 place .sff.buttonframe -relx 0.5 -rely 0.9 -anchor center pack .sff.buttonframe.ok -side left pack .sff.buttonframe.cancel -side right .sff.name insert 0 $mask focus .sff.name tkwait window .sff if { [ file isdirectory $filename ] } { cd $filename set path [ pwd ] } elseif { [ StringElement [ list $filename *?\[\] ] ] } { set mask $filename } else { set done 1 } } return $filename } wm geometry . 400x400 set Rfile [ SelectFile *.R ] exec R CMD BATCH $Rfile exit Then simply create the following file named helloR.R in the same directory: sink(helloR.out) cat(Hello, R\n) sink() chmod +x sourceRfile.tk ./sourceRfile.tk Select the file helloR.R from the resulting menu, and that file will be sourced by R. However, this is a bloody roundabout way to source a file in R. Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
[R] window manager interface commands for linux
How can i replicate this in Linux: source(file.choose()) I've tried source(tkgetOpenFile()) but with no luck __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window manager interface commands for linux
Have not found a way to do this either, or in any case it has been buggy. It would depend on the file manager you have installed. But, you're using Linux! The path and working directory are supposed to be half the fun. Maybe create an R folder in /home to keep your files and adjust your R terminal settings so that organization and dir() will get you what you want. Hope that helps, Ken Hutchison On Nov 28, 2554 BE, at 6:07 AM, Ana rrast...@gmail.com wrote: How can i replicate this in Linux: source(file.choose()) I've tried source(tkgetOpenFile()) but with no luck __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window?
Thank you. I am glad I asked. It wasn't giving answers that I expected and now I know why. Rather than pull in another package just for this functionality, I will just reassign the frequency by generating a new time series like: dswin - window(ds, start=..., end=...) dswin - ts(dswin, frequency=1) That should work shouldn't it? Thanks again. Kevin On Tue, Nov 8, 2011 at 9:40 PM, R. Michael Weylandt wrote: Like Denis said, you are asking ts to do things that don't make sense; in particular, some of your statements suggest you don't fully understand what window does or what its frequency argument does. Specifically, when you set frequency = 1 in window, that doesn't mean take a window and treat it as if it has frequency 1; rather take the subseries corresponding to yearly observations. Since 53 is prime, there is no regular subseries you can extract with window() other than the original series and the yearly series. ts objects are required to have a frequency so statements like now that I am taking a subset there is no frequency don't really make sense. Take a look at these examples: ## Create some working data ds.53 - ts(rnorm(53*2), frequency=53, start=c(2000,10)) ds.48 - ts(rnorm(48*2), frequency = 48, start = c(2000,10)) ## These all work window(ds.53, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.53, frequency = 53) # Returns every element of ds.53 window(ds.48, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.48, frequency = 12) # Returns elements seq(1, 48, by = 4) of ds.48 window(ds.48, frequency = 48) # Returns every element of ds.48 ## These don't window(ds.53, frequency = 7) window(ds.48, frequency = 9) Here's how you could do the same with xts. library(xts) library(forecast) x = xts(rnorm(53*2), Sys.Date() + 365*seq(0, 2, by = 1/53)) ets(x) # Auto-conversion to ts Michael On Tue, Nov 8, 2011 at 8:19 PM, Kevin Burton rkevinbur...@charter.net wrote: The problem is when I use the window function an try to extract a subset of the time series an specify the frequency as 1 (not only will ets not take a time series with a frequency greater than 24, now that I am taking a subset there is no frequency so I would like to set it to 1 (which is one of the arguments to the window function) but it does not produce what I expect. That is the problem. I fail to see the relationship of the discussion of what frequency is and how to use the forecast package with this problem. -Original Message- From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Tuesday, November 08, 2011 6:20 PM To: Kevin Burton Cc: R. Michael Weylandt; r-help@r-project.org Subject: Re: [R] window? The ets() function in the forecast package requires either a numeric vector or a Time-Series object (produced from ts()). The frequency argument in ts() refers to the time duration between observations; e.g., frequency = 7 means that the data are weekly; frequency = 12 means that the data are monthly; frequency = 4 means that the data are quarterly. You can see this from the examples on the help page of ts: ?ts at the R prompt. The example associated with the forecast::ets() function uses the USAccDeaths data: data(USAccDeaths) USAccDeaths ## monthly data for six years # Simulate the same structure with ts: u - ts(rnorm(72), start = c(1973, 1), frequency = 12) u # Evidently you want to produce a multivariate series; # here's one way with monthly frequency: v - ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v Is that more or less what you were after? Dennis On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton rkevinbur...@charter.net wrote: I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin
Re: [R] window?
Yes, that will definitely create a time series with the desired frequency, though the actual time index won't correspond to the original so you may need to exercise a little bit of caution in interpreting the outputs of ets(). Glad this could help, Michael On Wed, Nov 9, 2011 at 9:15 AM, rkevinbur...@charter.net wrote: Thank you. I am glad I asked. It wasn't giving answers that I expected and now I know why. Rather than pull in another package just for this functionality, I will just reassign the frequency by generating a new time series like: dswin - window(ds, start=..., end=...) dswin - ts(dswin, frequency=1) That should work shouldn't it? Thanks again. Kevin On Tue, Nov 8, 2011 at 9:40 PM, R. Michael Weylandt wrote: Like Denis said, you are asking ts to do things that don't make sense; in particular, some of your statements suggest you don't fully understand what window does or what its frequency argument does. Specifically, when you set frequency = 1 in window, that doesn't mean take a window and treat it as if it has frequency 1; rather take the subseries corresponding to yearly observations. Since 53 is prime, there is no regular subseries you can extract with window() other than the original series and the yearly series. ts objects are required to have a frequency so statements like now that I am taking a subset there is no frequency don't really make sense. Take a look at these examples: ## Create some working data ds.53 - ts(rnorm(53*2), frequency=53, start=c(2000,10)) ds.48 - ts(rnorm(48*2), frequency = 48, start = c(2000,10)) ## These all work window(ds.53, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.53, frequency = 53) # Returns every element of ds.53 window(ds.48, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.48, frequency = 12) # Returns elements seq(1, 48, by = 4) of ds.48 window(ds.48, frequency = 48) # Returns every element of ds.48 ## These don't window(ds.53, frequency = 7) window(ds.48, frequency = 9) Here's how you could do the same with xts. library(xts) library(forecast) x = xts(rnorm(53*2), Sys.Date() + 365*seq(0, 2, by = 1/53)) ets(x) # Auto-conversion to ts Michael On Tue, Nov 8, 2011 at 8:19 PM, Kevin Burton rkevinbur...@charter.net wrote: The problem is when I use the window function an try to extract a subset of the time series an specify the frequency as 1 (not only will ets not take a time series with a frequency greater than 24, now that I am taking a subset there is no frequency so I would like to set it to 1 (which is one of the arguments to the window function) but it does not produce what I expect. That is the problem. I fail to see the relationship of the discussion of what frequency is and how to use the forecast package with this problem. -Original Message- From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Tuesday, November 08, 2011 6:20 PM To: Kevin Burton Cc: R. Michael Weylandt; r-help@r-project.org Subject: Re: [R] window? The ets() function in the forecast package requires either a numeric vector or a Time-Series object (produced from ts()). The frequency argument in ts() refers to the time duration between observations; e.g., frequency = 7 means that the data are weekly; frequency = 12 means that the data are monthly; frequency = 4 means that the data are quarterly. You can see this from the examples on the help page of ts: ?ts at the R prompt. The example associated with the forecast::ets() function uses the USAccDeaths data: data(USAccDeaths) USAccDeaths ## monthly data for six years # Simulate the same structure with ts: u - ts(rnorm(72), start = c(1973, 1), frequency = 12) u # Evidently you want to produce a multivariate series; # here's one way with monthly frequency: v - ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v Is that more or less what you were after? Dennis On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton rkevinbur...@charter.net wrote: I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class
[R] window?
Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d - rep(1:53,2) (s - ts(d, frequency=53, start=c(2000,10))) n - length(s) k - n%/%3 for(i in (n-k):n) { st - c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] + i) %% frequency(s)) ed - c(start(s)[1] + (start(s)[2]+k+i)%/%frequency(s), (start(s)[2]+i+k) %% frequency(s)) xshort - window(s, start=st, end=ed) cat(Start , st, End , ed, \n) cat(Length , length(xshort), start , start(xshort), end , end(xshort), \n) } I get a bunch of warnings like: 36: In window.default(x, ...) : 'end' value not changed Thank you. Kevin rkevinbur...@charter.net [[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] window?
On 08.11.2011 16:26, Kevin Burton wrote: Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d- rep(1:53,2) (s- ts(d, frequency=53, start=c(2000,10))) n- length(s) k- n%/%3 for(i in (n-k):n) { st- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] + i) %% frequency(s)) ed- c(start(s)[1] + (start(s)[2]+k+i)%/%frequency(s), (start(s)[2]+i+k) %% frequency(s)) xshort- window(s, start=st, end=ed) cat(Start , st, End , ed, \n) cat(Length , length(xshort), start , start(xshort), end , end(xshort), \n) } I get a bunch of warnings like: 36: In window.default(x, ...) : 'end' value not changed Yes, your original s has End = c(2002, 9) and you try to set to, e.g., c(2002, 45) in your last iteration which is later and hence cannot be changed. Uwe ligges Thank you. Kevin rkevinbur...@charter.net [[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] window?
This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one value shows up in the window. When no frequency is specified I get all 10 values but now the time series has a frequency that I don't want. Comments? Kevin [[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] window?
I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one value shows up in the window. When no frequency is specified I get all 10 values but now the time series has a frequency that I don't want. Comments? Kevin [[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] window?
I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one value shows up in the window. When no frequency is specified I get all 10 values but now the time series has a frequency that I don't want. Comments? Kevin [[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] window?
The ets() function in the forecast package requires either a numeric vector or a Time-Series object (produced from ts()). The frequency argument in ts() refers to the time duration between observations; e.g., frequency = 7 means that the data are weekly; frequency = 12 means that the data are monthly; frequency = 4 means that the data are quarterly. You can see this from the examples on the help page of ts: ?ts at the R prompt. The example associated with the forecast::ets() function uses the USAccDeaths data: data(USAccDeaths) USAccDeaths ## monthly data for six years # Simulate the same structure with ts: u - ts(rnorm(72), start = c(1973, 1), frequency = 12) u # Evidently you want to produce a multivariate series; # here's one way with monthly frequency: v - ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v Is that more or less what you were after? Dennis On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton rkevinbur...@charter.net wrote: I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one value shows up in the window. When no frequency is specified I get all 10 values but now the time series has a frequency that I don't want. Comments? Kevin [[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-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window?
The problem is when I use the window function an try to extract a subset of the time series an specify the frequency as 1 (not only will ets not take a time series with a frequency greater than 24, now that I am taking a subset there is no frequency so I would like to set it to 1 (which is one of the arguments to the window function) but it does not produce what I expect. That is the problem. I fail to see the relationship of the discussion of what frequency is and how to use the forecast package with this problem. -Original Message- From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Tuesday, November 08, 2011 6:20 PM To: Kevin Burton Cc: R. Michael Weylandt; r-help@r-project.org Subject: Re: [R] window? The ets() function in the forecast package requires either a numeric vector or a Time-Series object (produced from ts()). The frequency argument in ts() refers to the time duration between observations; e.g., frequency = 7 means that the data are weekly; frequency = 12 means that the data are monthly; frequency = 4 means that the data are quarterly. You can see this from the examples on the help page of ts: ?ts at the R prompt. The example associated with the forecast::ets() function uses the USAccDeaths data: data(USAccDeaths) USAccDeaths ## monthly data for six years # Simulate the same structure with ts: u - ts(rnorm(72), start = c(1973, 1), frequency = 12) u # Evidently you want to produce a multivariate series; # here's one way with monthly frequency: v - ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v Is that more or less what you were after? Dennis On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton rkevinbur...@charter.net wrote: I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one value shows up in the window. When no frequency is specified I get all 10 values but now the time series has a frequency that I don't want. Comments? Kevin [[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-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window?
Like Denis said, you are asking ts to do things that don't make sense; in particular, some of your statements suggest you don't fully understand what window does or what its frequency argument does. Specifically, when you set frequency = 1 in window, that doesn't mean take a window and treat it as if it has frequency 1; rather take the subseries corresponding to yearly observations. Since 53 is prime, there is no regular subseries you can extract with window() other than the original series and the yearly series. ts objects are required to have a frequency so statements like now that I am taking a subset there is no frequency don't really make sense. Take a look at these examples: ## Create some working data ds.53 - ts(rnorm(53*2), frequency=53, start=c(2000,10)) ds.48 - ts(rnorm(48*2), frequency = 48, start = c(2000,10)) ## These all work window(ds.53, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.53, frequency = 53) # Returns every element of ds.53 window(ds.48, frequency = 1) # Returns elements 1 54 of ds.53 window(ds.48, frequency = 12) # Returns elements seq(1, 48, by = 4) of ds.48 window(ds.48, frequency = 48) # Returns every element of ds.48 ## These don't window(ds.53, frequency = 7) window(ds.48, frequency = 9) Here's how you could do the same with xts. library(xts) library(forecast) x = xts(rnorm(53*2), Sys.Date() + 365*seq(0, 2, by = 1/53)) ets(x) # Auto-conversion to ts Michael On Tue, Nov 8, 2011 at 8:19 PM, Kevin Burton rkevinbur...@charter.net wrote: The problem is when I use the window function an try to extract a subset of the time series an specify the frequency as 1 (not only will ets not take a time series with a frequency greater than 24, now that I am taking a subset there is no frequency so I would like to set it to 1 (which is one of the arguments to the window function) but it does not produce what I expect. That is the problem. I fail to see the relationship of the discussion of what frequency is and how to use the forecast package with this problem. -Original Message- From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Tuesday, November 08, 2011 6:20 PM To: Kevin Burton Cc: R. Michael Weylandt; r-help@r-project.org Subject: Re: [R] window? The ets() function in the forecast package requires either a numeric vector or a Time-Series object (produced from ts()). The frequency argument in ts() refers to the time duration between observations; e.g., frequency = 7 means that the data are weekly; frequency = 12 means that the data are monthly; frequency = 4 means that the data are quarterly. You can see this from the examples on the help page of ts: ?ts at the R prompt. The example associated with the forecast::ets() function uses the USAccDeaths data: data(USAccDeaths) USAccDeaths ## monthly data for six years # Simulate the same structure with ts: u - ts(rnorm(72), start = c(1973, 1), frequency = 12) u # Evidently you want to produce a multivariate series; # here's one way with monthly frequency: v - ts(matrix(rnorm(106), ncol = 2), start = c(2001, 1), frequency = 12) v Is that more or less what you were after? Dennis On Tue, Nov 8, 2011 at 2:04 PM, Kevin Burton rkevinbur...@charter.net wrote: I expect the frequency to be set to what I set it at and the window to return all of the data in the window from the original time series. The error is not because it is prime. I can generate a time series with just 52 values (or 10) and it still occurs. I am building these objects for use with the 'forecast' packages and one of the methods 'ets' cannot handle a frequency above 24 so I set it (or try to) to 1. Will 'window' take z zoo or xts object? Can I convert from zoo or xts to ts? -Original Message- From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] Sent: Tuesday, November 08, 2011 2:28 PM To: Kevin Burton Cc: r-help@r-project.org Subject: Re: [R] window? I'm not entirely sure that your request makes sense: what do you expect the frequency to be? It makes sense to me as is...Might your troubles be because 53 is prime? More generally, most people don't like working with the raw ts class and prefer the zoo or xts packages because they are much more pleasant for most time series work. You might want to take a look into those. Michael On Tue, Nov 8, 2011 at 3:18 PM, Kevin Burton rkevinbur...@charter.net wrote: This doesn't seem to work: d - rnorm(2*53) ds - ts(d, frequency=53, start=c(2000,10)) dswin - window(ds, start=c(2001,1), end=c(2001,10), frequency=1) dswin Time Series: Start = 2001 End = 2001 Frequency = 1 [1] 1.779409 dswin - window(ds, start=c(2001,1), end=c(2001,10)) dswin Time Series: Start = c(2001, 1) End = c(2001, 10) Frequency = 53 [1] 1.7794090 0.6916779 -0.6641813 -0.7426889 -0.5584049 -0.2312959 [7] -0.0183454 -1.0026301 0.4534920 0.6058198 The problem is that when the frequency is specified only one
[R] strange error message from freedesktop.org in the R window!
Almost continuously I get some variant of the following message fillingb up my R console: bubble(data1, logvol) ?variogram ** (evince:2799): WARNING **: DBus error org.freedesktop.DBus.Error.Failed: Unable to set metadata key ** (evince:2799): WARNING **: DBus error org.freedesktop.DBus.Error.Failed: Unable to set metadata key ?variogram and once it hang up and I had to restart the computer. This is R-2.11.1 compiled by myself on ubuntu 10.04 (but this mail is sent from an windows machine because of some internet probs on my linux machine). I havent'done anything special in the compilation of R, but I have done one chasnge of configuration of ubuntu (probably gnome) which can (or cannot) be relevant. because of some annoying problems with emacs 23, I went to System---Preferences---Appearnace and choose ThemeClearlooks (which also is better on my eyesighy) and Visual effects none. This in effect turns of the nvidia driver, and seems to keep emacs 23 hqappy. But why this strange Freedesktop.org messages above? --- Whivh repeat with an annoying freequency. \ Thanksd Kjetil Halvorsen __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] Programmatically minimising main R window (on windows)
Hi all, Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need. Thanks, 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] Programmatically minimising main R window (on windows)
On Tue, 16 Dec 2008, hadley wickham wrote: Hi all, Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need. Not from R itself, but you can by Windows script programming (which you can launch by 'system'. It would also be esay to add a small bit of C code to do so. However why are you using Rgui if you don't want a GUI? That is what Rterm or Rscript or embedded R are for. -- 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] Programmatically minimising main R window (on windows)
On Tue, Dec 16, 2008 at 5:40 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Tue, 16 Dec 2008, hadley wickham wrote: Hi all, Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need. Not from R itself, but you can by Windows script programming (which you can launch by 'system'. It would also be esay to add a small bit of C code to do so. However why are you using Rgui if you don't want a GUI? That is what Rterm or Rscript or embedded R are for. That's a good question. The main reason is because it's easy for me to tell my remote user how to load the gui - source(http://;) 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] Programmatically minimising main R window (on windows)
G'day Hadley, On Tue, 16 Dec 2008 18:54:48 -0600 hadley wickham h.wick...@gmail.com wrote: On Tue, Dec 16, 2008 at 5:40 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Tue, 16 Dec 2008, hadley wickham wrote: [...] Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need. Not from R itself, but you can by Windows script programming (which you can launch by 'system'. It would also be esay to add a small bit of C code to do so. [...] Not sure if this is what you are after, but I believe we had once a similar problem. Client wanted to have a GUI that would read in a file with the list of people who had bought Raffle tickets, select the winners, and write the winners to a file. They were just interested in seeing the GUI stuff and not the underlying R main window c. We ended up giving them an USB stick with R on it and the package we wrote for them together with other packages they needed. I attach the instructions that I wrote up for our consultant (sitting in Perth) on how I could create such an USB stick (sitting in Singapore). UWA has an authenticating proxy while NUS does not, hence the references to --internet2 on that write up. As it turned out, if you do not use the standard way of installing R but select SDI during the installation (if memory serves correctly, this choice can also be made after R is installed, but then doing this change is a bit more involved), then you can start R minimized. That is the R main window does not appear. You just have to make sure that your code is executed when you start R (via .onAttach, .First c) and brings up the GUI that the user is supposed to see. HTH. Cheers, Berwin === Full address = Berwin A TurlachTel.: +65 6515 4416 (secr) Dept of Statistics and Applied Probability+65 6515 6650 (self) Faculty of Science FAX : +65 6872 3919 National University of Singapore 6 Science Drive 2, Blk S16, Level 7 e-mail: sta...@nus.edu.sg Singapore 117546http://www.stat.nus.edu.sg/~statba 1) Install R on USB stick: Start R installer (named something like (R-2.x.y-win32.exe). During installation: i) Select drive corresponding to USB stick for location to which R is to be installed (i.e. if USB stick is drive DRV, then install R to location DRV:\R-2.x.y). ii) Customize startup: a) select SDI, everything else per default b) may be necessary to select internet2 as internet connection if sitting behind a proxy (but it is also possible to do so later, i.e o.k. to use the default) iii) Don't create a Start Menu folder iv) Don't create desktop icon or registry entries 2) Create a short cut to Rgui.exe (located in DRV:\R-2.x.y\bin\Rgui.exe) and move it to the top folder of the USB stick. Optionally, rename short cut (e.g. Raffle Draw) 3) Start R using the short cut. 4) Select Install package(s) from local zip files from Packages menu: select RaffleDraw_1.y.zip (currently y=1, but may change) for installation. 5) Select Install package(s)... from Packages menu: select appropriate CRAN mirror, then select gWidgets and gWidgetsrJava to be installed. quit R If this step does not work, then you are probably sitting behind a proxy. In that case, go to the short cut that points to Rgui.exe, right click on the short cut and select properties from pop-up window; add --internet2 to the target (i.e. the target should read something like DRV:\R-2.x.y\bin\Rgui.exe --internet2). Click Apply and then Ok and try again. 6) Right-click on short cut and select properties from pop-up window; change entry for Run: from Normal window to minimized. Click Apply and then Ok. (Remove the --internet2 option if it had been added) 7) Goto to the folder DRV:\R-2.x.y\etc and edit the Rprofile.site file located in that folder: add library(RaffleDraw) as last line (without the quotation marks) save file and quit 8) go to top folder of USB stick and double click on the short cut. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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 window lines limit
Hi, Is the number of lines that can be displayed in R GUI limited? When I do a Fourier Tranform of 4000 data points, I can only see the last 300 or so of it. I need to see all of it. How is this possible? Thank you if you can help! -- View this message in context: http://www.nabble.com/R-window-lines-limit-tp20735974p20735974.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] R window lines limit
On Fri, Nov 28, 2008 at 9:00 AM, Rthoughts [EMAIL PROTECTED] wrote: Hi, Is the number of lines that can be displayed in R GUI limited? When I do a Fourier Tranform of 4000 data points, I can only see the last 300 or so of it. I need to see all of it. How is this possible? Perhaps you could tell us why you want to see all the 4000 data points. It's unlikely that looking at 4,000 numbers is going to give you much insight into your data. Perhaps you are trying to save out the data? 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 window lines limit
Try ?View On Fri, Nov 28, 2008 at 10:00 AM, Rthoughts [EMAIL PROTECTED] wrote: Hi, Is the number of lines that can be displayed in R GUI limited? When I do a Fourier Tranform of 4000 data points, I can only see the last 300 or so of it. I need to see all of it. How is this possible? Thank you if you can help! -- View this message in context: http://www.nabble.com/R-window-lines-limit-tp20735974p20735974.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] R window lines limit
On 28/11/2008 10:00 AM, Rthoughts wrote: Hi, Is the number of lines that can be displayed in R GUI limited? Which GUI? In Windows, the console buffer size is configurable. The defaults are 250,000 characters, 8000 lines; it doesn't sound as though you are hitting those limits. But if you want to change them, go to Edit | Gui preferences. When I look at fft(rnorm(4000)), I see all 4000 values; my limit appears to be around 8000 values, using the default settings. Duncan Murdoch When I do a Fourier Tranform of 4000 data points, I can only see the last 300 or so of it. I need to see all of it. How is this possible? Thank you if you can help! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Why worry about that, Alberto, when you can use my ammazing function: mm2in(x) return(x/25.4) thus: par(pin=mm2in(126)) 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] window (x,y) co-ordinates of datapoints
On 10/10/07, Jim Lemon [EMAIL PROTECTED] wrote: Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Why worry about that, Alberto, when you can use my ammazing function: mm2in(x) return(x/25.4) thus: par(pin=mm2in(126)) But be sure to use it consistently! http://www4.cnn.com/TECH/space/9911/10/orbiter.03/ ;) 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] window (x,y) co-ordinates of datapoints
Hadley Wickham wrote: Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Why worry about that, Alberto, when you can use my ammazing function: mm2in(x) return(x/25.4) thus: par(pin=mm2in(126)) But be sure to use it consistently! http://www4.cnn.com/TECH/space/9911/10/orbiter.03/ ;) That's why it should not be done _at all_, and all functions should have SI inputs (unless you are from Liberia, Myanmar, etc). Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
On Tue, 9 Oct 2007, Samuel Kemp wrote: Hi, In the getGraphicsEvent function the (x,y) co-ordinates returned from the mouse move are in relation to where the mouse is located within the device window (i.e. the lower left corner of the window is '(0,0)', the upper right is '(1,1)'). You do realise that is specific to the windows() device? The getGraphicsEvent() help does not say what happens on the windows() device if 'rescale != R', when the 'window' is not simply related to the device surface -- so I'll ignore that. Is there a way of returning the (x,y) co-ordinates of data points plotted where instead of x and y being the actual data points they are the coordinates of the device window. e.g. below is a simple plot of x,y data x - 1:10 y - x*20 plot(x,y) x[4] 4 y[4] 80 what I actually want to know is where (x[4],y[4]) is within the device window. Does any-one have any ideas? Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. You have only one figure, no outer margins and linear scales. For your example on Linux (after resizing) I got par(din) [1] 9.162549 6.407743 par(mai) [1] 1.0407480 0.8366798 0.8366798 0.4285433 par(pin) [1] 7.897326 4.530315 which tells me the plot region has corners (0.8366798, 1.0407480) and (9.162549-0.8366798, 6.407743-0.4285433) and par(usr) [1] 0.64 10.36 12.80 207.20 tells me the user coordinates of those corners. That suffices to do the mapping. Thanks in advance, Sam [[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. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? Alberto Monteiro __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
On 10/9/2007 8:16 AM, Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? I don't think so (why mm, not cm or m or km?), but grid allows you to specify the units for most measurements, so one day you may be able to do that in whatever passes for par() by then. 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] window (x,y) co-ordinates of datapoints
Duncan Murdoch murdoch at stats.uwo.ca writes: On 10/9/2007 8:16 AM, Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? I don't think so (why mm, not cm or m or km?), but grid allows you to specify the units for most measurements, so one day you may be able to do that in whatever passes for par() by then. Duncan Murdoch For anyone interested, there is a larger selection of units online here, as well as other places, http://en.wikipedia.org/wiki/SI_prefix upon seeing which, I wondered (in the spirit of a google) if there was a prefix beyond yotta called lotta? ken -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau Département Neurosciences Intégratives 18 avenue du Doyen Lépine 69500 Bron France __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
On 10/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 9 Oct 2007, Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? No. R is quite capable of scaling by 25.4. Where did the inches come from? Is it for compatibility with S-plus? I can't imagine that Ross would have used inches by default. 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] window (x,y) co-ordinates of datapoints
On Tue, 9 Oct 2007, hadley wickham wrote: On 10/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Tue, 9 Oct 2007, Alberto Monteiro wrote: Prof Brian Ripley wrote: Read ?par and the descriptiuon in 'An Introduction to R'. din, fin, mai, omi, pin and usr are relevant. Is there any hope that, instead of fin, din, pin, etc someday we will have fmm, dmm, pmm? No. R is quite capable of scaling by 25.4. Where did the inches come from? Is it for compatibility with S-plus? I can't imagine that Ross would have used inches by default. From S's precursor GR-Z as I recall, from the 1970s. Note that all the base graphics devices are sized in inches (the pixel ones came later and are Guido's or mine), and most of those are Ross's doing. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/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] window (x,y) co-ordinates of datapoints
Look at the cnvrt.coords function in the TeachingDemos package, it does this type of thing for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Samuel Kemp Sent: Tuesday, October 09, 2007 4:59 AM To: [EMAIL PROTECTED] Subject: [R] window (x,y) co-ordinates of datapoints Hi, In the getGraphicsEvent function the (x,y) co-ordinates returned from the mouse move are in relation to where the mouse is located within the device window (i.e. the lower left corner of the window is '(0,0)', the upper right is '(1,1)'). Is there a way of returning the (x,y) co-ordinates of data points plotted where instead of x and y being the actual data points they are the coordinates of the device window. e.g. below is a simple plot of x,y data x - 1:10 y - x*20 plot(x,y) x[4] 4 y[4] 80 what I actually want to know is where (x[4],y[4]) is within the device window. Does any-one have any ideas? Thanks in advance, Sam [[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.