Re: [R] prefixing list names in print

2006-08-09 Thread Laurent Deniau
bogdan romocea wrote: A simple function will do what you want, customize this as needed: lprint - function(lst,prefix) { for (i in 1:length(lst)) { cat(paste(prefix,$,names(lst)[i],sep=),\n) print(lst[[i]]) cat(\n) } } P - list(A=a,B=b) lprint(P,Prefix) I thought that there is a

[R] prefixing list names in print

2006-08-08 Thread Laurent Deniau
With print(list(A=a,B=b)) it displays $A [1] a $B [1] b I would like to add a common prefix to all the list tags after the $. Pasting the prefix to the names does not work (appear after the $). For example if the prefix would be P, it should display: P$A [1] a P$B [1] b I tried to add a

Re: [R] prefixing list names in print

2006-08-08 Thread Uwe Ligges
Laurent Deniau wrote: With print(list(A=a,B=b)) it displays $A [1] a $B [1] b I would like to add a common prefix to all the list tags after the $. Pasting the prefix to the names does not work (appear after the $). For example if the prefix would be P, it should display:

Re: [R] prefixing list names in print

2006-08-08 Thread Prof Brian Ripley
On Tue, 8 Aug 2006, Laurent Deniau wrote: With print(list(A=a,B=b)) it displays $A [1] a $B [1] b I would like to add a common prefix to all the list tags after the $. `prefix' ... `after'? You seem to want to prefix component names: why? What do you want for component $a$b$c?

Re: [R] prefixing list names in print

2006-08-08 Thread bogdan romocea
] [mailto:[EMAIL PROTECTED] On Behalf Of Laurent Deniau Sent: Tuesday, August 08, 2006 12:25 PM To: R-help Subject: [R] prefixing list names in print With print(list(A=a,B=b)) it displays $A [1] a $B [1] b I would like to add a common prefix to all the list tags after the $. Pasting