🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.stats.s
Article #259

Re: [S] Strange error from tree()

#259
From: Prof Brian D Ripley
Date: Fri, 03 Aug 2001 17:34
61 lines
3237 bytes
On Fri, 3 Aug 2001, Sung, Myong-Hee  (NCI) wrote:

> Hi all,
>
> I got a mysterious error from running command tree() inside my script.  The
> relevant
> part of the code is:
>
> tree(factor(c(rep("P",nP),rep("N",nN)))~.,data=data.frame(rbind(bind,nonbind
> )))
>
> The error message is "Object "nP" not found".  But nP is clearly defined and
> has the
> correct value just before tree() is run as can be seen by cat().
> I tried different names for nP but that didn't help.
>
> What could be the problem?

Scope, I expect.  Just set up the response in advance and put it in the
data argument:

Y <-  factor(c(rep("P",nP),rep("N",nN))
tree(Y ~ ., data = data.frame(Y, rbind(bind,nonbind)))

> (SPLUS2000 on Windows)
>
> Myong-Hee
>
> Myong-Hee Sung, Ph.D.
>
> Molecular Statistics and Bioinformatics Section
> Biometric Research Branch
> Division of Cancer Treatment and Diagnosis
> National Cancer Institute
> National Institutes of Health
> 6130 Executive Blvd. EPN Room 8146, MSC 7434
> Bethesda, MD 20892-7434
>
> sungm@mail.nih.gov
> phone: 301-402-0364
> fax:      301-402-0560
>
>
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
>

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news
---
Technical Details
Message-ID: <Pine.WNT.4.31.0108031817280.1308-100000@tern.stats>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news1.optus.net.au!optus!news.usyd.edu.au!news.nsw.CSIRO.AU!cmis.csiro.au!owner-s-news
References: <76D006EB9224D411B12B0008C7C59D960136FCE6@nihexchange9.nih.gov>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fa931,13fc4f578c49dc91
X-Google-Attributes: gidfa931,public
X-Google-ArrivalTime: 2001-08-03 10:55:56 PST
Newsgroups: aus.stats.s
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!news1.optus.net.au!optus!news.usyd.edu.au!news.nsw.CSIRO.AU!cmis.csiro.au!owner-s-news
From: ripley@stats.ox.ac.uk (Prof Brian D Ripley)
Subject: Re: [S] Strange error from tree()
X-Nntp-Posting-Host: snowy.nsw.cmis.csiro.au
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.WNT.4.31.0108031817280.1308-100000@tern.stats>
X-Cc: <s-news@wubios.wustl.edu>
Sender: majordomo@mailhost.nsw.cmis.CSIRO.AU
Organization: CSIRO Australia
X-In-Reply-To: <76D006EB9224D411B12B0008C7C59D960136FCE6@nihexchange9.nih.gov>
References: <76D006EB9224D411B12B0008C7C59D960136FCE6@nihexchange9.nih.gov>
X-To: "Sung, Myong-Hee  (NCI)" <sungm@mail.nih.gov>
Mime-Version: 1.0
Date: Fri, 3 Aug 2001 17:34:55 GMT
Content-Length: 1919
X-Precedence: bulk
X-Received: from tern.stats (max177.public.ox.ac.uk [192.76.27.177])
 by toucan.stats.ox.ac.uk (8.9.0/8.9.0) with ESMTP id SAA25135;
 Fri, 3 Aug 2001 18:19:48 +0100 (BST)
Lines: 61