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
|