An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130429/08065cab/attachment.pl>
How to "call" an object given a string?
3 messages · Rui Esteves, Eik Vettorazzi, arun
Hi Rui, how about this sapply(ls(),get) cheers Am 29.04.2013 13:07, schrieb Rui Esteves:
Hello, This is very basic and very frustrating. Suppose this:
A=5 B=5 C=10
ls()
"A" "B" "C" I would like this
xpto()
5 5 10 How can I do xpto()? Thanks Rui [[alternative HTML version deleted]]
______________________________________________ R-help at 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.
Eik Vettorazzi Institut f?r Medizinische Biometrie und Epidemiologie Universit?tsklinikum Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Martin Zeitz (Vorsitzender), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
Hi,?res<- unlist(mget(ls())) names(res)<-NULL ?res #[1]? 5? 5 10 A.K. ----- Original Message ----- From: Rui Esteves <ruimaximo at gmail.com> To: r-help at r-project.org Cc: Sent: Monday, April 29, 2013 7:07 AM Subject: [R] How to "call" an object given a string? Hello, This is very basic and very frustrating. Suppose this:
A=5 B=5 C=10
ls()
"A" "B" "C" I would like this
xpto()
5 5 10 How can I do xpto()? Thanks Rui ??? [[alternative HTML version deleted]] ______________________________________________ R-help at 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.