🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.stats.s
Article #278

Re: [S] grouped function arguments

#278
From: "David L Lorenz"
Date: Tue, 07 Aug 2001 12:38
137 lines
5767 bytes
Matt,
  If you know that Y is a vector of length 4, why not try this.
Fakefunc(Y[1], Y[2], Y[3], Y[4], x5)
Dave



                                                                                                             
                    "Kurbat, Matt"                                                                           
                    <Matt.Kurbat@kmv.com>             To:     "'McDonald, Simon,'" <smcdonald@csu.edu.au>    
                    Sent by:                          cc:     "'s-news@lists.biostat.wustl.edu'"             
                    s-news-owner@lists.biostat        <s-news@lists.biostat.wustl.edu>                       
                    .wustl.edu                        Subject:     Re: [S] grouped function arguments        
                                                                                                             
                                                                                                             
                    08/06/2001 09:33 PM                                                                      
                                                                                                             
                                                                                                             




>Like this?
>
>          FakeFunc<-function(Y, x5)
>          {
>                    sum(Y)+x5
>          }

I'm sorry if my posting wasn't clear.
My real function is much more complicated.
I'm using the one I gave as a simplified example of my problem.

My intent was to find a way to convert (Y, x5)
to the same format as (x1, x2, x3, x4, x5).

So for example, the appropriate function call might look something like
           FakeFunc(unpaste(Y), x5)

That solution fails, but it gives you the flavor - I can't modify
the inside of the function at all.

Thanks,
Matt


-----Original Message-----
From: McDonald, Simon, [mailto:smcdonald@csu.edu.au]
Sent: Monday, August 06, 2001 7:22 PM
To: Kurbat, Matt
Subject: RE: [S] grouped function arguments


Like this?

           FakeFunc<-function(Y, x5)
           {
                     sum(Y)+x5
           }

Is this what you mean?

Simon

:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:
Simon McDonald
Information Technology Officer (Spatial Analysis)
Charles Sturt University

Spatial Data Analysis Network (SPAN) - Albury/Thurgoona
Division of Information Technology
Charles Sturt University
PO Box 789
ALBURY  NSW
Australia  2640

Phone: +61 (02) 6051 9922
Fax: +61 (02) 6051 9919
Email: smcdonald@csu.edu.au
Website: http://wwwdb.csu.edu.au/division/dit/span/
:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:




> -----Original Message-----
> From: Kurbat, Matt [mailto:Matt.Kurbat@kmv.com]
> Sent: Tuesday, 7 August 2001 12:03
> To: s-news@lists.biostat.wustl.edu
> Subject: [S] grouped function arguments
>
>
>
> Dear Splus Users,
>
> Say I have a function that takes five numeric arguments.
>          FakeFunc<-function(x1, x2, x3, x4, x5)
>          {
>                    x1+x2+x3+x4+x5
>          }
>
> Four of the arguments are already in the vector Y:
>          Y<-c(0.6765, 0.9602, 0.6889, 0.7836)
>
> To call my function, I'd like to be able to feed it Y and x5,
> instead of
> x1-x5,
> something like
>          FakeFunc(Y, x5)
>
> My question is: is it possible to do this so as not to get an error,
> and if so, how?
>
> Thank you and Best Regards,
>
> Matt Kurbat
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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




---------------------------------------------------------------------
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: <OF41BE83C7.12043FE9-ON86256AA1.00442773@cr.usgs.gov>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news-out.visi.com!hermes.visi.com!news1.optus.net.au!optus!news.usyd.edu.au!news.nsw.CSIRO.AU!cmis.csiro.au!owner-s-news

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fa931,daed7d039bfd621f
X-Google-Attributes: gidfa931,public
X-Google-ArrivalTime: 2001-08-07 05:44:09 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-out.visi.com!hermes.visi.com!news1.optus.net.au!optus!news.usyd.edu.au!news.nsw.CSIRO.AU!cmis.csiro.au!owner-s-news
From: lorenz@usgs.gov ("David L Lorenz")
Subject: Re: [S] grouped function arguments
X-Nntp-Posting-Host: snowy.nsw.cmis.csiro.au
Content-Type: text/plain; charset=us-ascii
Message-ID: <OF41BE83C7.12043FE9-ON86256AA1.00442773@cr.usgs.gov>
X-Cc: s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu,
        smcdonald@csu.edu.au
X-Mimetrack: Serialize by Router on gssdsflm03/SERVER/USGS/DOI(Release 5.0.7 |March 21, 2001) at
 08/07/2001 07:26:15 AM
Sender: majordomo@mailhost.nsw.cmis.CSIRO.AU
Organization: CSIRO Australia
X-To: "Kurbat, Matt" <Matt.Kurbat@kmv.com>
Mime-Version: 1.0
Date: Tue, 7 Aug 2001 12:38:37 GMT
X-Mailer: Lotus Notes Release 5.0.1b September 30, 1999
Content-Length: 4271
X-Precedence: bulk
X-Received: from gssdsflm03.cr.usgs.gov (gssdsflm03.cr.usgs.gov [152.61.128.81])
 by wubios.wustl.edu (8.9.3/8.9.3) with ESMTP id HAA14212;
 Tue, 7 Aug 2001 07:26:14 -0500 (CDT)
Lines: 137