gmane.comp.lang.r.general.mbox

来自「R-Project是一个开源的统计软件,专门有一个R语言,类似S语言,这个包里面」· MBOX 代码 · 共 1,572 行 · 第 1/5 页

MBOX
1,572
字号
From news@gmane.org Tue Mar 04 03:33:20 2003From: "Petr Pikal" <petr.pikal@precheza.cz>Subject: Re: Plotting multiple smooth lines on the same graphDate: Fri, 15 Dec 2006 17:47:03 +0100Lines: 56Message-ID: <4582DF97.26169.12A889F@localhost>References: <1166190144.4582a641009a0@webmail.cryst.bbk.ac.uk>Mime-Version: 1.0Content-Type: text/plain; charset="us-ascii"Content-Transfer-Encoding: 7bitX-From: r-help-bounces@stat.math.ethz.ch Fri Dec 15 17:48:26 2006Return-path: <r-help-bounces@stat.math.ethz.ch>Envelope-to: gclrg-r-help@gmane.orgReceived: from hypatia.math.ethz.ch ([129.132.145.15])	by dough.gmane.org with esmtp (Exim 4.50)	id 1GvGEQ-0005NQ-JS	for gclrg-r-help@gmane.org; Fri, 15 Dec 2006 17:48:22 +0100Received: from hypatia.math.ethz.ch (hypatia [129.132.145.15])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFGlN0t005823;	Fri, 15 Dec 2006 17:47:49 +0100X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on hypatia.math.ethz.chX-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_50,	FORGED_RCVD_HELO autolearn=no version=3.1.7Received: from mail.precheza.cz (mail.precheza.cz [80.188.29.243])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFGlBuw005713	for <r-help@stat.math.ethz.ch>; Fri, 15 Dec 2006 17:47:11 +0100Received: from localhost (localhost [127.0.0.1])	by mail.precheza.cz (Mailer) with ESMTP id 27F2F34E585;	Fri, 15 Dec 2006 17:47:07 +0100 (CET)Received: from mail.precheza.cz ([127.0.0.1])	by localhost (mail.precheza.cz [127.0.0.1]) (amavisd-new, port 10024)	with LMTP id 08457-05-11; Fri, 15 Dec 2006 17:47:05 +0100 (CET)Received: from n5en1.precheza.cz (smtp.precheza.cz [192.168.210.35])	by mail.precheza.cz (Mailer) with ESMTP id 9AB3634E582;	Fri, 15 Dec 2006 17:47:05 +0100 (CET)Received: from pikal ([192.168.210.65])	by n5en1.precheza.cz (Lotus Domino Release 7.0.1FP1)	with ESMTP id 2006121517470616-1293 ;	Fri, 15 Dec 2006 17:47:06 +0100 To: Eleni Rapsomaniki <e.rapsomaniki@mail.cryst.bbk.ac.uk>,        r-help@stat.math.ethz.chPriority: normalIn-reply-to: <1166190144.4582a641009a0@webmail.cryst.bbk.ac.uk>X-mailer: Pegasus Mail for Windows (4.21c)X-MIMETrack: Itemize by SMTP Server on SRVDomino/PRECHEZA(Release 7.0.1FP1 |	May 25, 2006) at 15.12.2006 17:47:06,	Serialize by Router on SRVDomino/PRECHEZA(Release 7.0.1FP1 | May 25,	2006) at 15.12.2006 17:47:07,	Serialize complete at 15.12.2006 17:47:07Content-description: Mail message bodyX-Virus-Scanned: by amavisd-new at stat.math.ethz.chX-BeenThere: r-help@stat.math.ethz.chX-Mailman-Version: 2.1.9Precedence: listList-Id: "Main R Mailing List: Primary help" <r-help.stat.math.ethz.ch>List-Unsubscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=unsubscribe>List-Archive: <https://stat.ethz.ch/pipermail/r-help>List-Post: <mailto:r-help@stat.math.ethz.ch>List-Help: <mailto:r-help-request@stat.math.ethz.ch?subject=help>List-Subscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=subscribe>Sender: r-help-bounces@stat.math.ethz.chErrors-To: r-help-bounces@stat.math.ethz.chArchived-At: <http://permalink.gmane.org/gmane.comp.lang.r.general/75840>Hiyou can either use supsmu smootherplot(d1) # make sure limits for axes are OK (which is not in this case and you need to set xlim and ylim accordinglylines(supsmu(d1[,1], d1[,2]))points(d2, pch=2) lines(supsmu(d2[,1], d2[,2]))or you can use loess smoother which is used in scatter.smooth and do some ordering before plotting and similar plot lines points lines construction.HTHPetrOn 15 Dec 2006 at 13:42, Eleni Rapsomaniki wrote:Date sent:      	Fri, 15 Dec 2006 13:42:25 +0000From:           	Eleni Rapsomaniki <e.rapsomaniki@mail.cryst.bbk.ac.uk>To:             	r-help@stat.math.ethz.chSubject:        	[R] Plotting multiple smooth lines on the same graph> Hi> > Say we have the following data sets:> d1=cbind(rnorm(100,1,1), rnorm(100,10,50))> d2=cbind(rnorm(100,5,1), rnorm(100,1,5))> > I want to plot them both on the same graph with a curve fitted for> each. I could call scatter.smooth to plot the first curve, but how do> I add the second?> > scatter.smooth(d1)> > Many thanks> Eleni Rapsomaniki> > ______________________________________________> 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.Petr Pikalpetr.pikal@precheza.cz______________________________________________R-help@stat.math.ethz.ch mailing listhttps://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.From news@gmane.org Tue Mar 04 03:33:20 2003From: "R. Villegas" <villegas.ro@gmail.com>Subject: Re: series de tiempo diariasDate: Fri, 15 Dec 2006 19:50:49 +0100Lines: 22Message-ID: <29cf68350612151050t54b140b3tcef7623e280db5b2@mail.gmail.com>References: <cedd6fb60612150715u41e82a55w99387d352dad2b0d@mail.gmail.com>Mime-Version: 1.0Content-Type: text/plain; charset="utf-8"Content-Transfer-Encoding: base64Cc: r-help@stat.math.ethz.chX-From: r-help-bounces@stat.math.ethz.ch Fri Dec 15 19:55:52 2006Return-path: <r-help-bounces@stat.math.ethz.ch>Envelope-to: gclrg-r-help@gmane.orgReceived: from hypatia.math.ethz.ch ([129.132.145.15])	by dough.gmane.org with esmtp (Exim 4.50)	id 1GvIDo-0007Ov-2M	for gclrg-r-help@gmane.org; Fri, 15 Dec 2006 19:55:52 +0100Received: from hypatia.math.ethz.ch (hypatia [129.132.145.15])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFIp7aj015172;	Fri, 15 Dec 2006 19:53:21 +0100X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on hypatia.math.ethz.chX-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AWL,	BAYES_50 autolearn=no version=3.1.7Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.236])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFIos5P015127	for <r-help@stat.math.ethz.ch>; Fri, 15 Dec 2006 19:50:54 +0100Received: by wr-out-0506.google.com with SMTP id i4so494864wra	for <r-help@stat.math.ethz.ch>; Fri, 15 Dec 2006 10:50:53 -0800 (PST)Received: by 10.78.138.6 with SMTP id l6mr365079hud.1166208649429;	Fri, 15 Dec 2006 10:50:49 -0800 (PST)Received: by 10.78.182.6 with HTTP; Fri, 15 Dec 2006 10:50:49 -0800 (PST)To: "Santiago Cilintano" <santiagote@gmail.com>In-Reply-To: <cedd6fb60612150715u41e82a55w99387d352dad2b0d@mail.gmail.com>Content-Disposition: inlineX-Virus-Scanned: by amavisd-new at stat.math.ethz.chX-MIME-Autoconverted: from base64 to 8bit by hypatia.math.ethz.ch id	kBFIos5P015127X-BeenThere: r-help@stat.math.ethz.chX-Mailman-Version: 2.1.9Precedence: listList-Id: "Main R Mailing List: Primary help" <r-help.stat.math.ethz.ch>List-Unsubscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=unsubscribe>List-Archive: <https://stat.ethz.ch/pipermail/r-help>List-Post: <mailto:r-help@stat.math.ethz.ch>List-Help: <mailto:r-help-request@stat.math.ethz.ch?subject=help>List-Subscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=subscribe>Sender: r-help-bounces@stat.math.ethz.chErrors-To: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5jbHVkZSAgYXJpbWEoKSAgZm9yIEFSSU1BIG1vZGVsbGluZyBhbmQgQm94LUplbmtpbnMtdHlwZQphbmFseXNpcy4KClBsZWFzZSByZWFkIHRoZSBwb3N0aW5nLWd1aWRlLCBodHRwOi8vd3d3LnItcHJvamVjdC5vcmcvcG9zdGluZy1ndWlkZS5odG1sCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClItaGVscEBzdGF0Lm1hdGguZXRoei5jaCBtYWlsaW5nIGxpc3QKaHR0cHM6Ly9zdGF0LmV0aHouY2gvbWFpbG1hbi9saXN0aW5mby9yLWhlbHAKUExFQVNFIGRvIHJlYWQgdGhlIHBvc3RpbmcgZ3VpZGUgaHR0cDovL3d3dy5SLXByb2plY3Qub3JnL3Bvc3RpbmctZ3VpZGUuaHRtbAphbmQgcHJvdmlkZSBjb21tZW50ZWQsIG1pbmltYWwsIHNlbGYtY29udGFpbmVkLCByZXByb2R1Y2libGUgY29kZS4KFrom news@gmane.org Tue Mar 04 03:33:20 2003From: "Muenchen, Robert A (Bob)" <muenchen@utk.edu>Subject: Switching labels on a factorDate: Fri, 15 Dec 2006 15:34:15 -0500Lines: 66Message-ID: <7270AEC73132194E8BC0EE06B35D93D84A061C@UTKFSVS3.utk.tennessee.edu>Mime-Version: 1.0Content-Type: text/plain; charset="us-ascii"Content-Transfer-Encoding: 7bitX-From: r-help-bounces@stat.math.ethz.ch Fri Dec 15 21:38:58 2006Return-path: <r-help-bounces@stat.math.ethz.ch>Envelope-to: gclrg-r-help@gmane.orgReceived: from hypatia.math.ethz.ch ([129.132.145.15])	by dough.gmane.org with esmtp (Exim 4.50)	id 1GvJpW-0004R1-MV	for gclrg-r-help@gmane.org; Fri, 15 Dec 2006 21:38:54 +0100Received: from hypatia.math.ethz.ch (hypatia [129.132.145.15])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFKajD8015866;	Fri, 15 Dec 2006 21:37:25 +0100X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on hypatia.math.ethz.chX-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,	BAYES_50 autolearn=no version=3.1.7Received: from liger.mail.utk.edu (liger.mail.utk.edu [160.36.178.184])	by hypatia.math.ethz.ch (8.13.6/8.13.6) with ESMTP id kBFKaNxI015707	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL)	for <R-help@stat.math.ethz.ch>; Fri, 15 Dec 2006 21:36:24 +0100X-ASG-Debug-ID: 1166214982-768300240000-ttKww0X-Barracuda-URL: http://tigon.mail.utk.edu:8000/cgi-bin/mark.cgiX-Barracuda-Connect: utkfscb3.utk.tennessee.edu[160.36.76.190]X-Barracuda-Start-Time: 1166214982Received: from UTKFSVS3.utk.tennessee.edu (utkfscb3.utk.tennessee.edu	[160.36.76.190])	by liger.mail.utk.edu (Spam Firewall) with ESMTP id A15FB7D9DEB	for <R-help@stat.math.ethz.ch>; Fri, 15 Dec 2006 15:36:22 -0500 (EST)X-MimeOLE: Produced By Microsoft Exchange V6.5Content-class: urn:content-classes:messageX-ASG-Orig-Subj: Switching labels on a factorX-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Switching labels on a factorThread-Index: AccgiGNBNkD+I6nwTNm73QQr00XxQw==To: <R-help@stat.math.ethz.ch>X-Barracuda-Virus-Scanned: by Barracuda Spam Firewall at mail.utk.eduX-Virus-Scanned: by amavisd-new at stat.math.ethz.chX-MIME-Autoconverted: from quoted-printable to 8bit by hypatia.math.ethz.ch id	kBFKaNxI015707X-BeenThere: r-help@stat.math.ethz.chX-Mailman-Version: 2.1.9Precedence: listList-Id: "Main R Mailing List: Primary help" <r-help.stat.math.ethz.ch>List-Unsubscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=unsubscribe>List-Archive: <https://stat.ethz.ch/pipermail/r-help>List-Post: <mailto:r-help@stat.math.ethz.ch>List-Help: <mailto:r-help-request@stat.math.ethz.ch?subject=help>List-Subscribe: <https://stat.ethz.ch/mailman/listinfo/r-help>,	<mailto:r-help-request@stat.math.ethz.ch?subject=subscribe>Sender: r-help-bounces@stat.math.ethz.chErrors-To: r-help-bounces@stat.math.ethz.chArchived-At: <http://permalink.gmane.org/gmane.comp.lang.r.general/75842>Hi All,I'm perplexed by the way the unclass function displays a factor whoselabels have been swapped with the relevel function. I realize it won'taffect any results and that the relevel did nothing useful in thisparticular case. I'm just doing it to learn ways to manipulate factors.The display of unclass leaves me feeling that the relevel had failed.I've checked three books & searched R-help, but found no mention of thisparticular issue.  The program below demonstrates the problem. Is this a bug, or is there areason for it to work this way?Thanks,Bobmystring<-("id,workshop,gender,q1,q2,q3,q4 1,1,f,1,1,5,1 2,2,f,2,1,4,1 3,1,f,2,2,4,3 4,2,f,3,1, ,3 5,1,m,4,5,2,4 6,2,m,5,4,5,5 7,1,m,5,3,4,4 8,2,m,4,5,5,9")mydata<-read.table(textConnection(mystring),   header=TRUE,sep=",",row.names="id",na.strings="9")mydata# Create a gender Releveled variable, gR. # Now 1=m, 2=fmydata$gR <- relevel(mydata$gender, "m")# Print the data to show that the labels of gR match those of gender.mydata# Show that the underlying codes have indeed reversed.as.numeric(mydata$gender)as.numeric(mydata$gR)# Unclass the two variables to see that print order # implies that both the codes and labels have# flipped, cancelling each other out. For gR,# m appears to be associated with 2, and f with 1unclass(mydata$gender)unclass(mydata$gR)=========================================================

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?