Hi all, I have been attempting to access the source code for the keyword ?function? to better understand how it assigns and stores logical inputs, like in the subset() [base] function. Does anyone know how I can access the source code for this? For example, if I have norm <- function(x){ sqrt(x%*%x)) } I am looking for the source code for the ?function? portion, highlighted in red. Thank you for your time and assistance, Shelby Golden Lab Researcher Technician Dr. Russell Bowler?s Lab Department of Medicine National Jewish Health in Denver, CO Phone: (303) 270-2598 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. [[alternative HTML version deleted]]
1. This is a plain text list; all html is stripped. So there is no red highlighting. 2. There is no "source code" for "function" -- it is a reserved keyword. Or are you looking for R's formal grammar -- e.g. how it parses input to determine correct syntax? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Sep 6, 2019 at 8:51 AM Golden, Shelby <GoldenS at njhealth.org> wrote:> Hi all, > > I have been attempting to access the source code for the keyword > ?function? to better understand how it assigns and stores logical inputs, > like in the subset() [base] function. Does anyone know how I can access the > source code for this? > > For example, if I have > norm <- function(x){ > sqrt(x%*%x)) > } > I am looking for the source code for the ?function? portion, highlighted > in red. > > Thank you for your time and assistance, > Shelby Golden > Lab Researcher Technician > Dr. Russell Bowler?s Lab > Department of Medicine > National Jewish Health in Denver, CO > Phone: (303) 270-2598 > > NOTICE: This email message is for the sole use of the intended > recipient(s) and may contain confidential and privileged information. Any > unauthorized review, use, disclosure or distribution is prohibited. If you > are not the intended recipient, please contact the sender by reply email > and destroy all copies of the original message. > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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]]
Hello Bert, Thank you for the reply and your clarifications. Yes, it might be helpful to look into R?s formal grammar to see how ?function? parses input to delegate correct syntax. Is that accessible online? Thank you, Shelby From: Bert Gunter <bgunter.4567 at gmail.com> Date: Friday, September 6, 2019 at 10:44 AM To: "Golden, Shelby" <GoldenS at NJHealth.org> Cc: "r-help at R-project.org" <r-help at r-project.org>, "Gillenwater, Lucas" <GILLENWATERL at NJHEALTH.ORG> Subject: Re: [R] [R-devel] Source Code for function 1. This is a plain text list; all html is stripped. So there is no red highlighting. 2. There is no "source code" for "function" -- it is a reserved keyword. Or are you looking for R's formal grammar -- e.g. how it parses input to determine correct syntax? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Sep 6, 2019 at 8:51 AM Golden, Shelby <GoldenS at njhealth.org<mailto:GoldenS at njhealth.org>> wrote: Hi all, I have been attempting to access the source code for the keyword ?function? to better understand how it assigns and stores logical inputs, like in the subset() [base] function. Does anyone know how I can access the source code for this? For example, if I have norm <- function(x){ sqrt(x%*%x)) } I am looking for the source code for the ?function? portion, highlighted in red. Thank you for your time and assistance, Shelby Golden Lab Researcher Technician Dr. Russell Bowler?s Lab Department of Medicine National Jewish Health in Denver, CO Phone: (303) 270-2598 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help<http://mx2.njhealth.org:32224/?dmVyPTEuMDAxJiZmMWRiYmMxZjFmNmI5ZDBkMz01RDcyOEQwN18yMjk2OF8zOTk2XzEmJjljNzlmMDA4YWRmZTZjMz0xMjMzJiZ1cmw9aHR0cHMlM0ElMkYlMkZzdGF0JTJFZXRoeiUyRWNoJTJGbWFpbG1hbiUyRmxpc3RpbmZvJTJGci1oZWxw> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html<http://mx2.njhealth.org:32224/?dmVyPTEuMDAxJiZlMTkwYmMwMzFlNjk4ZTAzNz01RDcyOEQwN18yMjk2OF8zOTk2XzEmJmFkYTkxMWRkMWRhZTFkNz0xMjMzJiZ1cmw9aHR0cCUzQSUyRiUyRnd3dyUyRVItcHJvamVjdCUyRW9yZyUyRnBvc3RpbmctZ3VpZGUlMkVodG1s> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
Hi Shelby, Not quite sure what you are trying to do. Mine might be off-topic but have you seen this document? http://adv-r.had.co.nz/Functions.html#function-components It illustrates the components of a function. Best, Jiefei On Fri, Sep 6, 2019 at 11:52 AM Golden, Shelby <GoldenS at njhealth.org> wrote:> Hi all, > > I have been attempting to access the source code for the keyword > ?function? to better understand how it assigns and stores logical inputs, > like in the subset() [base] function. Does anyone know how I can access the > source code for this? > > For example, if I have > norm <- function(x){ > sqrt(x%*%x)) > } > I am looking for the source code for the ?function? portion, highlighted > in red. > > Thank you for your time and assistance, > Shelby Golden > Lab Researcher Technician > Dr. Russell Bowler?s Lab > Department of Medicine > National Jewish Health in Denver, CO > Phone: (303) 270-2598 > > NOTICE: This email message is for the sole use of the intended > recipient(s) and may contain confidential and privileged information. Any > unauthorized review, use, disclosure or distribution is prohibited. If you > are not the intended recipient, please contact the sender by reply email > and destroy all copies of the original message. > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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]]
Hello Jiefei, Missed this in the subsequent emails. That is a very intriguing article, but I do not believe that it quite answers my question. Regardless, I will review it, so thank you for sending it my way! Respectfully, Shelby From: Wang Jiefei <szwjf08 at gmail.com> Date: Friday, September 6, 2019 at 11:10 AM To: "Golden, Shelby" <GoldenS at NJHealth.org> Cc: "r-help at R-project.org" <r-help at r-project.org>, "Gillenwater, Lucas" <GILLENWATERL at NJHEALTH.ORG> Subject: Re: [R] [R-devel] Source Code for function Hi Shelby, Not quite sure what you are trying to do. Mine might be off-topic but have you seen this document? http://adv-r.had.co.nz/Functions.html#function-components<http://mx1.njhealth.org:32224/?dmVyPTEuMDAxJiYzZDQ2Y2Y3YzhmYmIwZmMzMz01RDcyOTJGNl81MzQ2N180NjY0XzEmJjBjMTRiYjE5NTI5MjI2MD0xMjMzJiZ1cmw9aHR0cCUzQSUyRiUyRmFkdi1yJTJFaGFkJTJFY28lMkVueiUyRkZ1bmN0aW9ucyUyRWh0bWwlMjNmdW5jdGlvbi1jb21wb25lbnRz> It illustrates the components of a function. Best, Jiefei On Fri, Sep 6, 2019 at 11:52 AM Golden, Shelby <GoldenS at njhealth.org<mailto:GoldenS at njhealth.org>> wrote: Hi all, I have been attempting to access the source code for the keyword ?function? to better understand how it assigns and stores logical inputs, like in the subset() [base] function. Does anyone know how I can access the source code for this? For example, if I have norm <- function(x){ sqrt(x%*%x)) } I am looking for the source code for the ?function? portion, highlighted in red. Thank you for your time and assistance, Shelby Golden Lab Researcher Technician Dr. Russell Bowler?s Lab Department of Medicine National Jewish Health in Denver, CO Phone: (303) 270-2598 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org<mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help<http://mx1.njhealth.org:32224/?dmVyPTEuMDAxJiYyODRhOWIzMTgzZmQ0ZWQ0Nz01RDcyOTJGNl81MzQ2N180NjY0XzEmJmVlZTUyYjI5NzMzNjQ2Mz0xMjMzJiZ1cmw9aHR0cHMlM0ElMkYlMkZzdGF0JTJFZXRoeiUyRWNoJTJGbWFpbG1hbiUyRmxpc3RpbmZvJTJGci1oZWxw> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html<http://mx1.njhealth.org:32224/?dmVyPTEuMDAxJiYyZTRkOGI3YTgzZTE0ZmQ2Nj01RDcyOTJGNl81MzQ2N180NjY0XzEmJmRlMDExYWY5OTJlM2Y2Nj0xMjMzJiZ1cmw9aHR0cCUzQSUyRiUyRnd3dyUyRVItcHJvamVjdCUyRW9yZyUyRnBvc3RpbmctZ3VpZGUlMkVodG1s> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]