On Sun, 29 Aug 2021, akshay kulkarni writes:

> Dear members,
>                              I think the following question is rudimentary, 
> but I couldn't find an answer in the Internet.
>
> Suppose there is an object A, and ls() lists it as "A". How do you convert 
> this character object to the object A. i.e I want a function f such that 
> class(f("A")) = class(A) (of course, class("A") = "character") . f should 
> just coerce the character to the object represented by it.


Perhaps ?get is what you're looking for:

  A <- 42
  get("A")
  ## [1] 42


> Thank you,
> Yours sincerely,
> AKSHAY M KULKARNI
>

-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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