Re: [R] coercion to an object...
dear Duncun, Thanks a lot... From: Duncan Murdoch Sent: Sunday, August 29, 2021 5:49 PM To: akshay kulkarni ; Enrico Schumann Cc: R help Mailing list ; r-help-requ...@r-project.org Subject: Re: [R] coercion to an object... On 29/08/2021 7:52 a.m., akshay kulkarni wrote: > dear Enrico, > it works. Thanks a lot. I spent over an hour looking > for this function in the web, but was bootless. Do you have any way to get > functions where you are given what it has to do? The most common case is that > you are given a list of functions, but they number to over 10. Any idea > to find them without resorting to help from another R expert? The sos package does a pretty good job, but your query needs to be fairly narrow or the result list will be really long. I don't think it would have found get() in the top hits given the words in your original question. Some questions need intelligence to interpret, not just pattern matching. Other than asking on this list, there's stackoverflow.com to get humans involved in the search. Duncan Murdoch > > yours sincerely > AKSHAY M KULKARNI > > > From: Enrico Schumann > Sent: Sunday, August 29, 2021 4:57 PM > To: akshay kulkarni > Cc: R help Mailing list ; r-help-requ...@r-project.org > > Subject: Re: [R] coercion to an object... > > 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 > > [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> > Virus-free. > www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> > >[[alternative HTML version deleted]] > > __ > 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. > [[alternative HTML version deleted]] __ 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.
Re: [R] coercion to an object...
On 29/08/2021 7:52 a.m., akshay kulkarni wrote: dear Enrico, it works. Thanks a lot. I spent over an hour looking for this function in the web, but was bootless. Do you have any way to get functions where you are given what it has to do? The most common case is that you are given a list of functions, but they number to over 10. Any idea to find them without resorting to help from another R expert? The sos package does a pretty good job, but your query needs to be fairly narrow or the result list will be really long. I don't think it would have found get() in the top hits given the words in your original question. Some questions need intelligence to interpret, not just pattern matching. Other than asking on this list, there's stackoverflow.com to get humans involved in the search. Duncan Murdoch yours sincerely AKSHAY M KULKARNI From: Enrico Schumann Sent: Sunday, August 29, 2021 4:57 PM To: akshay kulkarni Cc: R help Mailing list ; r-help-requ...@r-project.org Subject: Re: [R] coercion to an object... 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 [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> [[alternative HTML version deleted]] __ 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. __ 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.
Re: [R] coercion to an object...
dear Enrico, it works. Thanks a lot. I spent over an hour looking for this function in the web, but was bootless. Do you have any way to get functions where you are given what it has to do? The most common case is that you are given a list of functions, but they number to over 10. Any idea to find them without resorting to help from another R expert? yours sincerely AKSHAY M KULKARNI From: Enrico Schumann Sent: Sunday, August 29, 2021 4:57 PM To: akshay kulkarni Cc: R help Mailing list ; r-help-requ...@r-project.org Subject: Re: [R] coercion to an object... 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 [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> [[alternative HTML version deleted]] __ 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.
Re: [R] coercion to an object...
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.
[R] coercion to an object...
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. Thank you, Yours sincerely, AKSHAY M KULKARNI [[alternative HTML version deleted]] __ 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.