s-news
[Top] [All Lists]

Object Names in Functions

To: s-news@wubios.wustl.edu
Subject: Object Names in Functions
From: "Alastair Dempster" <demp2979@mach1.wlu.ca>
Date: Fri, 04 Jan 1980 04:11:35 -0500
Reply-to: demp2979@mach1.wlu.ca
This is a beginner question but I have looked at the archives and the 
documentation
and I still stuck.

I would like to keep some objects created inside a function and I would like
to specify their names dynamically.

My code is as follows:
myfunc<-function(theData)
{
x.spp<-spp(theData)
y<-paste(c(deparse(substitute(theData)),".spp"),collapse="") 
assign(y,spp(theData),immediate=T)
}

My function returns a null rather than the object I want and I am not sure why.
 If my input is say gr99e I expect an object named gr99e.spp to be created.


Can anyone set me straight?

Alastair Dempster
Wilfrid Laurier University
Waterloo, Canada

<Prev in Thread] Current Thread [Next in Thread>
  • Object Names in Functions, Alastair Dempster <=