Dear list members,
I am trying, within a lapply command, to print the name of the objects 
in list or data frame. This is so that I can use odfWeave to print out a 
report with a section for each object, including the object names.

I tried e.g.
a=b=c=1:5
lis=data.frame(a,b,c)
lapply(
lis, function (z) {
obj.nam <- deparse(substitute(z))
cat("some other text",obj.nam,"and so on","\n")
}
)


But instead of getting "a" "b" etc. I get X[[1L]] etc.

Any ideas?


www.promente.org

proMENTE social research

Krančevićeva 35
71000 Sarajevo

mob. +387 61 215 997
tel. +387 556 865
fax. +387 556 866


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to