Re: [R] Smoothing a path in 2D
?KalmanLike Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Wed, 30 May 2007, Dieter Vanderelst wrote: Hello, I'm currently trying to find a method to interpolate or smooth data that represent a trajectory in space. For example, I have an ordered (=time) set of (x,y) tuples which constitute a path in a 2D space. Is there a way using R to interpolate between these points in a way similar to spline interpolation so that I get a smooth path in space? Greetings, Dieter -- Dieter Vanderelst [EMAIL PROTECTED] Department of Industrial Design Designed Intelligence [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] negative number to positive number
?abs Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Wed, 25 Apr 2007 [EMAIL PROTECTED] wrote: Quoting H. Paul Benton [EMAIL PROTECTED]: Hello all, I know this is a pretty easy question but I can't find it in S poetry or R help. How can I make a negative number positive. Such as -5 to be +5 I tried +(-5), but that didn't work. So no, I don't mean taking a -5^2 just to get a positive number. This is in a function so it's not just -5 it's x. :) Thanks, Paul how about just multiplying it by -1??? :-) -5*(-1) Jose -- Dr. Jose I. de las Heras Email: [EMAIL PROTECTED] The Wellcome Trust Centre for Cell BiologyPhone: +44 (0)131 6513374 Institute for Cell Molecular BiologyFax: +44 (0)131 6507360 Swann Building, Mayfield Road University of Edinburgh Edinburgh EH9 3JR UK __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Opinion on R plots: connecting X and Y
Okay, Brant. It's Friday and I'm opinionated. Since the plotted data extend to lower values on both axes that 'n' draws them, I like 'l' better. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Fri, 20 Apr 2007, Inman, Brant A. M.D. wrote: Attention R users, especially those that are experienced enough to be opinionated, I need your input. Consider the following simple plot: x - rnorm(100) y - rnorm(100) plot(x, y, bty='n') A colleague (and dreaded SAS user) commented that she thought that my plots could be cleaned up by connecting the X and Y axes. I know that I can do that with bty='l' but I don't want to, I find that the plots look less cluttered with disjoint axes. However, I was intrigued enough by her comments that I decided to solicit the opinions of others on this issue. Are there principled reasons why one should prefer joined axes or disjoint axes? Brant Inman __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Wikibooks
On Fri, 30 Mar 2007, Peter Dalgaard wrote: Deepayan Sarkar wrote: On 3/30/07, Sarah Goslee [EMAIL PROTECTED] wrote: On 3/30/07, Alberto Monteiro [EMAIL PROTECTED] wrote: Deepayan Sarkar wrote: I was just looking at this page, and it makes me curious: what gives anyone the right to take someone else's mailing list post and include that in a Wiki? Thinks there were posted to public mailing lists are freely copied and distributed. It's a scary thought; I may have posted things in 10 or 12 years ago that might cause me problems today, but I was pretty aware that I was posting to the whole world. There's a difference between public archiving and copying. It's not that simple. Dealing with international contributors it's even worse. Under US law (the only one I'm familiar with), the author of a mailing list post or any other written work _automatically holds copyright_ to that post (although not to the ideas contained therein, but to that particular description of the ideas). (Of course, if the ideas are original to the author, it's good form to acknowledge that regardless of whether the exact words are used). I believe this is true for all countries that are signatory to the Berne convention (which is pretty much all countries [1]). The US in fact was one of the later ones to get into it, before which you had to explicitly copyright things if you wanted copyright. -Deepayan [1] http://upload.wikimedia.org/wikipedia/commons/6/6c/Berne_Convention.png Yes. It's pretty obvious that by posting you agree to publication, and presumably also to archiving. Think Letters to the Editor. However, you do not agree to just any republication (in particular not to commercial usage -- say someone wants to publish the collected works of a particularly prolific correspondent, without paying and obtaining consent). Interestingly, BYTE magazine back in the late 80's actually ran a Best of BIX column with postings from their bulletin board. I've always wondered how (and whether) they handled the copyright issues. There is a middle ground of fair use and the right to citation, though. I certainly don't expect to be cited by everyone using code snippets from one of my posts. -pd My wife has edited just such a collection (of Compuserve forum messages) and is currently engaged in writing another. And yes, obtaining and keeping track of a hundred citations through the editing process is quite the chore--but not so bad that she isn't willing to embark on another book. Needless to say, she cringes at the looseness of copyright tracking that occurs on email lists and wikis. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Double-banger function names: preferences and suggestions
I agree with Jason: !2, prefer 1, can accept 3. Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Thu, 1 Mar 2007, Jason Barnhart wrote: Definitely not #2. Prefer #1 but #3 is ok as well. Thanks for contributing and inquiring. - Original Message - From: hadley wickham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 25, 2007 7:44 AM Subject: [R] Double-banger function names: preferences and suggestions What do you prefer/recommend for double-banger function names: 1 scale.colour 2 scale_colour 3 scaleColour 1 is more R-like, but conflicts with S3. 2 is a modern version of number 1, but not many packages use it. Number 3 is more java-like. (I like number 2 best) Any suggestions? Thanks, Hadley __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] How to plot two graphs on one single plot?
?par try par(new=TRUE) between plots Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Fri, 23 Feb 2007, Yun Zhang wrote: Thanks. Now R plots two graphs on one plot. Yet they are still on two graphs, vertically parallelized with each other. But what I want to do is actually plotting two distribution on one single graph, using the same x and y axis. Like: | | | (dist2) | (dist 1) | --- Is it possible to do that? Thanks, Yun Henrique Dallazuanna wrote: par(mfrow=c(2,1)) #your plot #after plot par(mfrow=c(1,1)) On 23/02/07, *Yun Zhang* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, I am trying to plot two distribution graph on one plot. But I dont know how. I set them to the same x, y limit, even same x, y labels. Code: x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') plot(x2, y2, type='p', col=red, xlab='x', ylab='y') They just dont show up in one plot. Any hint will be very helpful. Thanks, Yun __ R-help@stat.math.ethz.ch mailto:R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Henrique Dallazuanna Curitiba-Paraná Brasil __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Progress Monitor in R
Or change the \n to \r so that the lines overwrite one another rather than producing a list that scrolls off the top. Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Tue, 24 Oct 2006, Weiwei Shi wrote: the way i do is like this for (i in 1:1000){ if (i %% 100){ # you can change this number cat(process monitor: i =, i, \n); } } hth, w. On 10/24/06, Xiaofan Cao [EMAIL PROTECTED] wrote: Hi there, I'm writing a program in R that has a few nested loops. I'd like to monitor the progress when the program is running and be able to estimate the remaining time. I'd highly appreciate it if anyone can shed a light on this issue. Thanks for your time! Best Regards, Martha Cao __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. Did you always know? No, I did not. But I believed... ---Matrix III __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] R-2.4.0 and MS Vista OS - installing packages
This week's eweek has an article on Vista's security and system administration--I'm guessing (a Linux user guess) that you are running afoul of Vista's User Account Control feature. Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Fri, 20 Oct 2006, Charles Annis, P.E. wrote: I have installed Microsoft Vista Release Candidate 1, and R-2.4.0, on a 4 year old DELL box with a 2.26 GHz P4 and 1 gig. It was a clean install R is the only non-MS program running. I cannot install packages from CRAN, nor from local zipped files. (I have R-2.4.0 installed on a Windows XP machine and have had no problems so the difficulty seems to be Vista not R, however they aren't playing together nicely as they should.) The CRAN installation of R-2.4.0 on the Vista machine was without incident, but after downloading the zipped packages from CRAN I get this error message: utils:::menuInstallPkgs() trying URL 'http://cran.us.r-project.org/bin/windows/contrib/2.4/RColorBrewer_0.2-3.zip ' Content type 'application/zip' length 39787 bytes opened URL downloaded 38Kb Error in zip.unpack(pkg, tmpDir) : cannot open file 'C:/Program Files/R/R-2.4.0/library/file6fc97ac2/RColorBrewer/chtml/RColorBrewer.chm' Any help would be appreciated. Thanks. Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] References verifying accuracy of R for basic statistical calculations and tests
Actually, you may not want R to agree so precisely with some of the packages since some well-known packages have some not-so-well-known inaccuracies. Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Thu, 13 Jul 2006, Corey Powell wrote: Do you know of any references that verify the accuracy of R for basic statistical calculations and tests. The results of these studies should indicate that R results are the same as the results of other statistical packages to a certain number of decimal places on some benchmark calculations. Thanks, Corey Powell Clinical Data Analyst Broncus Technologies [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Invoke operating system command
?system Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Thu, 13 Jul 2006, Gang Chen wrote: Hi all, How can I invoke an operating system command in R? I mean something like exclamation mark (!) inside Matlab. Thanks, Gang __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Polygon-like interactive selection of plotted points
Roger, Just for fun I tried your script--nothing wrong with the script, but I created a seven sided polygon by clicking on seven points and letting getpoly complete the figure. At the end I notice that only three of the seven vertices are coded as being inside the ploygon (the blue points.) I'd send you a screen dump but I haven't gotten xwd to work with Exceed. Also I haven't checked any docs to see whether this is a known problem but suspect that Marc could be surprised by the behavior. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Wed, 26 Apr 2006, Roger Bivand wrote: On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote: On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote: [Please CC me for all replies, since I am not currently subscribed to the list.] Hi all, I have the following problem/question: Imagine you have a two- dimensional plot, and you want to select a number of points, around which you could draw a polygon. The points of the polygon are defined by clicking in the graphics window (locator()/identify()), all points inside the polygon are returned as an object. Is something like this already implemented? Thanks a lot in advance, Florian I don't know if anyone has created a single function do to this (though it is always possible). However, using: RSiteSearch(points inside polygon) brings up several function hits that, if put together with the above interactive functions, could be used to do what you wish. That is, input the matrix of x,y coords of the interactively selected polygon and the x,y coords of the underlying points set to return the points inside or outside the polygon boundaries. This sequence from the splancs package should do it: library(splancs) set.seed(20060426) xy - cbind(x=runif(100), y=runif(100)) plot(xy) poly - getpoly() # this gets the polygon on-screen plot(xy) polygon(poly) io - inout(xy, poly) # this returns a logical vector for points in the polygon points(xy[io,], pch=16, col=blue) Roger Just as an FYI, you might also want to look at ?chull, which is in the base R distribution and returns the set of points on the convex hull of the underlying point set. This is to some extent, the inverse of what you wish to do. HTH, Marc Schwartz -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] www.r-project.org
I must agree with Jon--the site is clean and material is easily found and readily available. I wouldn't want changes which, while visually stimulating, would detract from the clarity of presentation. What I don't see is a way for the visitor to contact the Web page maintainer to comment or suggest changes. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Tue, 25 Apr 2006, Jonathan Baron wrote: On 04/25/06 18:53, Romain Francois wrote: Dear R users and developpers, My question is adressed to both of you, so I choose R-help to post it. Are there any plans to jazz up the main R website : http://www.r-project.org The look it have now is the same for a long time and kind of sad compared to other statistical package's website. Of course, the comparison is not fair, since companies are paying web designers to draw lollipop websites ... I don't think it is sad at all. It think it is one of the few sites I visit that is accessible, is quick to load, conforms to standards, uses my fonts instead of forcing me to get nose prints on the monitor, is informative, has minimal mindless glitz, and works in any browser. The only thing I might change is to replace the frames with some sort of CSS-based positioning. HOWEVER, the new version of Internet Explorer may totally destroy the usefulness of CSS, so maybe it is better to leave things as they are for now. Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron Editor: Judgment and Decision Making (http://journal.sjdm.org) __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [O/T] undergrads and R
It wasn't R but I've had a similar experience where a class came together to cause an uncharacteristic reaction to material which had been welcomed by previous classes (and also by later ones.) I'd say just put it down to a statistical fluctuation. Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534 USPS: PO Box 47600, Olympia, WA 98504-7600 Parcels:300 Desmond Drive, Lacey, WA 98503-1274 On Mon, 24 Apr 2006, Erin Hodgess wrote: Dear R People: Are your undergraduate students receptive to learning R, as a rule? Most of the time, mine really like it. But this semester, they act as though they are being eaten by rats when learning R. They are not trying at all. Any similar experiences? If anyone has any good ideas, I would be THRILLED to hear them, as I am using R in Summer School. Thanks, Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Uneven y-axis scale
Have you thought about using a log scale? Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 On Thu, 6 Apr 2006, Jim Lemon wrote: Kåre Edvardsen wrote: Dear R-gurus! Is it possible within boxplot to break the y-scale into two (or anything)? I'd like to have a normal linear y-range from 0-10 and the next tick mark starting at, say 60 and continue to 90. The reason is for better visualising the outliers. Hi Kare, In the plotrix package, there are two functions, gap.plot amd gap.barplot, that do something like this. If you think that they are sufficiently close to what you want, I could have a try at doing a gap.boxplot function. Jim __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Histogram over times (without dates)
I do analyses of that sort all the time with air quality data where I wish to begin to understand daily behavior -- works well in doing model evaluation as well. I'd say your approach should give you useful information; however, I'd think you'd also be interested in a possible day of week variation. On Thu, 24 Mar 2005, Greg Snow wrote: Have you looked at the CircStats and circular? They have some plotting functions that may be of help to you. Greg Snow, Ph.D. Statistical Data Center [EMAIL PROTECTED] (801) 408-8111 Dubravko Dolic [EMAIL PROTECTED] 03/24/05 09:38AM Dear Group, Having a character vector like this one: [1] 03:38:55 07:42:38 08:04:27 08:17:13 08:41:14 08:46:58 [7] 08:47:11 08:53:51 08:57:51 08:58:56 I try to do a histogram over times of a day. All I want to know, if my solution is proper or if there is another way to go. There is no Information about the day on which this time occurred. it is unimportant as I want to know at what times on a day a costumer buys anything (times are collected from logfiles). The values span 24 hours (e.g. 00:00:00 to 23:59:59) I converted the characters to chron objects (library(chron)) and then to numeric vectors: ordertm.num - as.numeric(chron(times = ecom$Ordertime)) Then I put the numeric values to hist(), printed the hist without axes=F and constructed my own axis. The result is satisfactory. But as there are so many possibilities with times on R (namely using the POSIX classes) I want to be shure if there is no standard approach to handle such time related problems (note that the date is irrelevant to my problem). have a goof Easter holiday All the best Dubravko Dolic Dubravko Dolic http://www.dolic.de/pagedd.html -- Statistik -- Tel: +49 (0)89-55 27 44 - 4630 Fax: +49 (0)89-55 27 44 - 2463 Email: [EMAIL PROTECTED] Komdat GmbH Nymphenburger Straße 86 / TH 3 80636 München Partners for your success www.komdat.com outbind://96-9676DC1A07BA5142BC1A44984B6E7FAC070052D1AC81378E9342947189B0417601470017F02352D1AC81378E9342947189B0417601470017F7DA/www.komdat.com [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Convex hull line coordinates..
?chull states: Value: An integer vector giving the indices of the points lying on the convex hull, in clockwise order. therefore (see Example in ?chull) you have the end points of each line segment from which you can compute the equation of each line segment. Since the precision of the calculation is finite, there will necessarily be some portion of each line that may fall on one side or the other of the true convex hull. Or am I off base? Clint On Mon, 21 Mar 2005, Romain Francois wrote: Hello, I'm not sure i got your question right, but i think the whole point is to find the equation of a line which passes by two points See ?lm Romain. Le 21.03.2005 11:09, [EMAIL PROTECTED] a écrit : Hello R-Helpers.. I am still new in R and I have the following question.. I am applying the function chull on a 2D dataset and have the convex hull nicely calculated and plotted. Do you know if there is a way to extract the coordinates of the line created from the connection of the chull data points.. I have alredy tried with approx to lineary interpolate but its not working correctly since the interpolated values sometimes fall inside the convex . Using the yleft or yright doesnt seem to help.. Any suggestions? Thank you in advance Achilleas Psomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Exponential Fits to Distribution Tails
EPA has suggested an exponential fit to the upper 10 percent of a PM10 distribution and using that fit to determine a once per year frequency of occurrence. My question is one of pedigree -- does such a technique have merit and status in the statistics community? Or is there a better technique for determining the PM10 value that is expected to occur once per year? TIA Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Revision: post on Intro to R lecture
Much improved (patched Firefox 1.0pre on RH9) On 25 Oct 2004, Arin Basu wrote: Hi All: This follows my earlier post on webized slides on lecture presentation on introducing R. I learned that in Mozilla (Firefox) browsers, the slides did not show up. Sorry for the no show. As a reluctant windows user, I kind of carelessly clicked through Powerpoint to convert the presentation file to its html form, unwittingly leading to the mess. See if it got corrected now (I do not have firefox yet in my computer, so no way of knowing whether it works), and please let me know. Also, made some changes and reformatted the original slides to make them other browser compatible, thanks to comments from Gabor Grothendiek, Stuart Lesk, and Sundar Dorai-Raj. Here is the URL again: http://www.aloofhosting.com/arinbasu/Rintroweb.htm /Arin Basu [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Slope of surface
If I recall my computer graphics (decades ago at Utah), doesn't the cross product enter in here? I'm hoping someone with more recent experience will have fewer cobwebs overlaying the knowledge here. Clint On Tue, 19 Oct 2004, Uwe Ligges wrote: Laura Quinn wrote: Hi, Is there a neat way of working out the slope of a flat surface in R? Given (x,y,z) co-ordinates of the four corners of a square, three should be sufficient s there a function which will allow me to calculate the mean slope of the surface in a given direction? Along the axis, one way without any thinking is to apply a regression with e=0, the neater way is to calculate the true result simply. Just insert one formula into the other ... Uwe Ligges Thanks in advance.. Laura Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] proportions confidence intervals
It seems to me that a transformation is in order since [0,1] can't possibly contain a normal distribution without cutting off both tails. On Mon, 12 Jul 2004, Rolf Turner wrote: Darren Shaw wrote: this may be a simple question - but i would appreciate any thoughts does anyone know how you would get one lower and one upper confidence interval for a set of data that consists of proportions. i.e. taking a usual confidence interval for normal data would result in the lower confidence interval being negative - which is not possible given the data (which is constrained between 0 and 1) i can see how you calculate a upper and lower confidence interval for a single proportion, but not for a set of proportions (1) Your question appears to be a bit ``off topic''. I.e. it is really about statistical methodology, rather than about how to implement methodology in R. (2) You need to make the scenario clearer. What do your data actually consist of? What are you assuming? The only reasonable scenario that springs to mind (perhaps this is merely indicative of poverty of imagination on my part) is that you have a number of ***independent*** samples, each yielding a sample proportion, and each coming from the same population (or at least from populations having the same population proportion ``p''. I.e. you have p.hat_1, ..., p.hat_n and from these you wish to calculate a confidence interval for p. You need to know the sample ***sizes*** for each sample. If you don't, you're screwed. Full stop. There is absolutely nothing sensible you can do. If you ***do*** know the sample sizes (say k_1, ..., k_n) then the problem is trivial. You have p.hat_j = x_j/k_j for j = 1, ..., n. Let x = x_1 + ... + x_n and k = k_1 + ... + k_n. Form p.hat = x/k. (I.e. you ***really*** just have one big happy sample.) Then calculate the confidence interval for p in the usual way: p.hat +/- (z-value) * sqrt(p.hat * (1 - p.hat)/k) If this is not the scenario with which you need to cope, then you'll have to explain what that scenario actually is. cheers, Rolf Turner [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Aggregating on Water Year Rather Than Calendar Year
The US water year extends from 01 October -1 through 30 September and is referenced by the year starting on the included 01 January . I'd like to be able to find the annual means for the water year. To do so I've taken the input date-time, which is in the usual format 1991-10-07 10:35:00 changed it by: w$d-as.POSIXct(w$date.time) Now I can add an offset of 92 days w$w.year-as.POSIXct(w$d+7948800) and have the years correspond to the water year. Now I wish to obtain some means by something like: waterT-aggregate(w$value[w$param.name==Temperature], list(w$w.year[w$param.name==Temperature]),mean) Except that I need to work on the year and being a neophyte in date arithmetic I'm not finding a working method. TIA Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Aggregating on Water Year Rather Than Calendar Year
Aha! I was unclear of the way to extract the year from the function call (which your example shows.) The following works wonders: w$w.year-as.POSIXlt(w$d+7948800)$year+1900 Again, thanks, Clint On Wed, 16 Jun 2004, Don MacQueen wrote: It's not clear where your problem is. Did w$w.year come out wrong? Or did the aggregate() function fail? For getting the water year, I would do it differently: (this is for a U.S. English locale, and minimally tested) tmp - as.POSIXlt(w$d)$year+1900 w$w.year - ifelse( format(w$d,'%b') %in% c('Oct','Nov','Dec'), tmp+1, tmp) Then you can do things like table(w$w.year) table(w$w.year,w$param.name) to help find out if w.year came out like it should. You'll have to provide error messages or something if the problem is with using aggregate(). At 11:21 AM -0700 6/16/04, Clint Bowman wrote: The US water year extends from 01 October -1 through 30 September and is referenced by the year starting on the included 01 January . I'd like to be able to find the annual means for the water year. To do so I've taken the input date-time, which is in the usual format 1991-10-07 10:35:00 changed it by: w$d-as.POSIXct(w$date.time) Now I can add an offset of 92 days w$w.year-as.POSIXct(w$d+7948800) Try w$w.year - w$d+7948800 and have the years correspond to the water year. Now I wish to obtain some means by something like: waterT-aggregate(w$value[w$param.name==Temperature], list(w$w.year[w$param.name==Temperature]),mean) Except that I need to work on the year and being a neophyte in date arithmetic I'm not finding a working method. TIA Clint -- Clint Bowman INTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of EcologyVOICE: (360) 407-6815 PO Box 47600 FAX:(360) 407-7534 Olympia, WA 98504-7600 -Don -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Aggregating on Water Year Rather Than Calendar Year
You are so correct as I didn't find it under ?year or ?fiscal.year (or ?year.fiscal) (again in the US begins on 1 October) or even ?year.water. On Wed, 16 Jun 2004, Prof Brian Ripley wrote: For future reference, ?months (and ?weekdays? and ?quarters and ?julian) tells you. It's hard to thing of a really obvious place to put this. -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] CRLF/LF line endings
A quick run through dos2unix should make the files right, e.g., dos2unix hem.c dos2unix random4f.h On Fri, 23 Apr 2004, Hyung Cho wrote: Dear all: I am developing a package in R. While I am running R CMD check, I found the following warning message: Found the following C sources/headers with CRLF line endings: src/hem.c src/random4f.h ISO C requires LF line endings. It seems that it comes from a line ending problem in C. What are CRLF/LF line endings? How can I fix it? Thank you for your help in advance. Best, HJ _ Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! http://join.msn.com/?pgmarket=en-uspage=hotmail/es2ST=1/go/onm00200362ave/direct/01/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Syntax Question
I have a large data structure that looks like: strsplit(st,,)[14395] [1] KGEG [2] SA = KGEG [3] 72785 [4] 47.62139 [5] -117.52778 [6] 723 [7] WA [8] US [9] 2 [10] SPOKANE SPOKANE INTERNATIONAL AIRPORT [11] 1 I'd like to be able to retrieve, for example, the latitude as.numeric(strsplit(st,,)[[14395]][4]) and longitude as.numeric(strsplit(st,,)[[14395]][5]) for the entry in the structure where strsplit(st,,)[[14395]][5])==KGEG by specifying various station IDs. That is, if I had a simpler structure I could formulate a logical index which would have something along the lines of as.numeric(st[st[1]==KSEA][4]) and it would return 47.62139. Somewhere I'm getting all bollixed up with the indexing and keep getting sytax errors. As you can see, the list is quite long (20K+) and I don't wish to have to look up each coordinate by hand. TIA Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Syntax Question
Thanks, I have gotten past the problem with good old grep: as.numeric(strsplit(st[grep(KGEG,st)],,)[[1]][4]) [1] 47.62139 The difficulty is trying to work with some complicated records that are coded up to work with perl. But grep will work perfectly. Thanks all, Clint On Wed, 7 Apr 2004, Jason Turner wrote: I have a large data structure that looks like: strsplit(st,,)[14395] [1] KGEG [2] SA = KGEG [3] 72785 [4] 47.62139 [5] -117.52778 [6] 723 [7] WA [8] US [9] 2 [10] SPOKANE SPOKANE INTERNATIONAL AIRPORT [11] 1 I'd like to be able to retrieve, for example, the latitude as.numeric(strsplit(st,,)[[14395]][4]) and longitude as.numeric(strsplit(st,,)[[14395]][5]) for the entry in the structure where strsplit(st,,)[[14395]][5])==KGEG by specifying various station IDs. That is, if I had a simpler structure I could formulate a logical index which would have something along the lines of as.numeric(st[st[1]==KSEA][4]) and it would return 47.62139. Too confusing for me. I'd just convert it to a data frame. ## UNTESTED!!! stm - t(matrix(st,nrow=11)) stdf - data.frame(stm) stdf[stdf[,1]==KSEA,4] ## OPTIONAL - just makes life easier later ## do some as.numeric calls to various columns. stdf[,x] - as.numeric(stdf[,x]) ## add some names names(stdf) - c(blah,...) ## /OPTIONAL Cheers Jason -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Winding Number
I have shapefiles for the state climatic divisions for the United States and read.shape brings them in wonderfully. Now I wish to run through a list of several thousand observation sites to find out in which division each is located. I figure that I can compute the winding number for each site and be done. However a search doesn't find any references and I can't find a winding number function among the map/tools/stats. I have the code for an efficient C++ but was expecting that it would already be implemented as an R function Since I haven't used the map/tools/stats collection before, I suspect I'm overlooking the function and would be thankful for a pointer. TIA Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Winding Number
Roger, Thanks for your reference. Since I can get the polygon coordinates (and have the coordinates of my sites, I can cobble together a function that will do the trick. Again, thanks, Clint On Fri, 2 Apr 2004, Roger Bivand wrote: On Fri, 2 Apr 2004, Clint Bowman wrote: I have shapefiles for the state climatic divisions for the United States and read.shape brings them in wonderfully. Now I wish to run through a list of several thousand observation sites to find out in which division each is located. I figure that I can compute the winding number for each site and be done. However a search doesn't find any references and I can't find a winding number function among the map/tools/stats. I have the code for an efficient C++ but was expecting that it would already be implemented as an R function Since I haven't used the map/tools/stats collection before, I suspect I'm overlooking the function and would be thankful for a pointer. This is work in progress - where all good ideas and contributions will be welcome. If you look on http://sourceforge.net/projects/r-spatial/, you will see an alpha package called sp, which already has a point-in-polygon facility, but which may not scale up to the kinds of data volumes you have, but which invites a spatial query (match polygon?) function between a SpatialDataFrame with point coordinates and a SpatialDataPolygons object (sometime). This is only as source packages so far, so Windows binaries are not yet available. I have used the splancs package inout() function before, trying the points coordinate matrix on each polygon in turn; splancs is available as a Windows binary. This ought to be less rough at the edges, and in time will be. The immediate solution is to use splancs, but this will not work if the Shapes have multiple polygons. There is a more specialised list for these kinds of questions in addition to r-help: https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-geo and since yesterday (thanks to Jonathan Baron), its archives are also searchable from: http://finzi.psych.upenn.edu/search.html This question hasn't come up there, but maybe we could move further discussion there - posting only for subscribers? TIA Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Interesting Behavior in plot()
I have a 2 by 226200 table, conveniently read in by read.table(), which exhibits some strange behavior when plotted by plot(V1,V2). The general pattern for the range of windspeeds, [0V150] is as expected -- the wind gust falls in the interval [V1V265] except for certain values of V2. For V2 == c(15,26,37,48,59), the V2 values are positioned at one-tenth of the V1 (i.e., as if I had issued the command plot(0.1*V1,V2) for just those values of V2 -- see attached plot, test.png). The only other values of V2 in the range, 4 and 70, also seem to be affected but aren't well enough represented to show up clearly on the plot. However, if I plot(ws$V1[ws$V2==48],ws$V2[ws$V2==48]), I see the second attachment, test2.png, which confirms that the wind speed (V1) really should be positioned where one would expect. I haven't seen any messages covering this behaviour and so am looking for an explanation. I'm running: R.Version() $platform [1] i686-pc-linux-gnu $arch [1] i686 $os [1] linux-gnu $system [1] i686, linux-gnu $status [1] $major [1] 1 $minor [1] 8.1 $year [1] 2003 $month [1] 11 $day [1] 21 $language [1] R on Red Hat 9.0. TIA, Clint -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 attachment: test.pngattachment: test2.png__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Interesting Behavior in plot()
Right on. The convenience of slurping up data with read.table() and the nearly expected plot caused me to overlook that V2 was read in as a factor. I also had quite a few NAs which may have contributed to the problem. Thanks On Mon, 29 Mar 2004, Duncan Murdoch wrote: On Mon, 29 Mar 2004 14:06:36 -0800 (PST), Clint Bowman [EMAIL PROTECTED] wrote : I have a 2 by 226200 table, conveniently read in by read.table(), which exhibits some strange behavior when plotted by plot(V1,V2). The general pattern for the range of windspeeds, [0V150] is as expected -- the wind gust falls in the interval [V1V265] except for certain values of V2. For V2 == c(15,26,37,48,59), the V2 values are positioned at one-tenth of the V1 (i.e., as if I had issued the command plot(0.1*V1,V2) for just those values of V2 -- see attached plot, test.png). The only other values of V2 in the range, 4 and 70, also seem to be affected but aren't well enough represented to show up clearly on the plot. However, if I plot(ws$V1[ws$V2==48],ws$V2[ws$V2==48]), I see the second attachment, test2.png, which confirms that the wind speed (V1) really should be positioned where one would expect. I haven't seen any messages covering this behaviour and so am looking for an explanation. I can't quite see how it would generate the symptoms you saw, but a common source of oddities is that data is read as factors rather than as numeric values. You can see the difference using the str() function, e.g. str(x) num [1:10] -0.4897 0.6804 0.6979 -0.1203 -0.0428 ... str(as.factor(x)) Factor w/ 10 levels -1.65972758..,..: 4 7 8 5 6 9 2 10 3 1 I'd check your V1 and V2. Duncan Murdoch -- Clint BowmanINTERNET: [EMAIL PROTECTED] Air Quality Modeler INTERNET: [EMAIL PROTECTED] Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7534 Olympia, WA 98504-7600 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html