Re: [R] Where to find source of C_pbinom?
On Aug 26, 2014, at 8:14 PM, Marius Hofert wrote: Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? www.r-project.org/doc/Rnews/Rnews_2006-4.pdf Pages 43-54 -- David Winsemius, MD Alameda, CA, USA __ R-help@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.
Re: [R] Where to find source of C_pbinom?
R FAQ 7.40 http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f Sarah On Tuesday, August 26, 2014, Marius Hofert marius.hof...@math.ethz.ch wrote: Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? Cheers, Marius -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org [[alternative HTML version deleted]] __ R-help@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.
Re: [R] Where to find source of C_pbinom?
Dear Sarah, Dear David, thanks for helping. I know the FAQ and I know the R News article, but I still couldn't figure it out. First, pbinom calls .External(C_pbinom,...). Grepping for C_pbinom reveals... nothing (except the appearance in .External). Going to ./src/main/names.c reveals {pbinom, do_math3, 5, 11, 3+2, {PP_FUNCALL, PREC_FN, 0}},, so the next step is to grep for do_math3 (which also applies for dbeta, pbeta,..., qnbinom_mu). There is a connection to pbinom again in ./src/main/arithmetic.c (SEXP attribute_hidden do_math3): Math3_2(args, pbinom) is called. src/library/stats/src/distn.c then shows that Math3_2(args, pbinom) is called. Since we just already grepped for Math3_2, the trip ends here. So how can one find the source code of pbinom() in this case? Cheers, Marius On Wed, Aug 27, 2014 at 7:28 AM, Sarah Goslee sarah.gos...@gmail.com wrote: R FAQ 7.40 http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f Sarah On Tuesday, August 26, 2014, Marius Hofert marius.hof...@math.ethz.ch wrote: Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? Cheers, Marius -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org __ R-help@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.
Re: [R] Where to find source of C_pbinom?
Hi, I have not followed the e-mail trail, but if you are looking for the C source code for pbinom, then it is pbinom.c in src/nmath. HTH, Ranjan On Wed, 27 Aug 2014 08:34:11 -0400 Marius Hofert marius.hof...@math.ethz.ch wrote: Dear Sarah, Dear David, thanks for helping. I know the FAQ and I know the R News article, but I still couldn't figure it out. First, pbinom calls .External(C_pbinom,...). Grepping for C_pbinom reveals... nothing (except the appearance in .External). Going to ./src/main/names.c reveals {pbinom, do_math3, 5, 11, 3+2, {PP_FUNCALL, PREC_FN, 0}},, so the next step is to grep for do_math3 (which also applies for dbeta, pbeta,..., qnbinom_mu). There is a connection to pbinom again in ./src/main/arithmetic.c (SEXP attribute_hidden do_math3): Math3_2(args, pbinom) is called. src/library/stats/src/distn.c then shows that Math3_2(args, pbinom) is called. Since we just already grepped for Math3_2, the trip ends here. So how can one find the source code of pbinom() in this case? Cheers, Marius On Wed, Aug 27, 2014 at 7:28 AM, Sarah Goslee sarah.gos...@gmail.com wrote: R FAQ 7.40 http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f Sarah On Tuesday, August 26, 2014, Marius Hofert marius.hof...@math.ethz.ch wrote: Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? Cheers, Marius -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org __ R-help@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. -- Important Notice: This mailbox is ignored: e-mails are set to be deleted on receipt. Please respond to the mailing list if appropriate. For those needing to send personal or professional e-mail, please use appropriate addresses. Can't remember your password? Do you need a strong and secure password? Use Password manager! It stores your passwords protects your account. __ R-help@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.
Re: [R] Where to find source of C_pbinom?
Dear Ranjan, thanks, that was what I was looking for. Somehow my 'grep' must have missed that. Cheers, Marius On Wed, Aug 27, 2014 at 8:34 AM, Marius Hofert marius.hof...@math.ethz.ch wrote: Dear Sarah, Dear David, thanks for helping. I know the FAQ and I know the R News article, but I still couldn't figure it out. First, pbinom calls .External(C_pbinom,...). Grepping for C_pbinom reveals... nothing (except the appearance in .External). Going to ./src/main/names.c reveals {pbinom, do_math3, 5, 11, 3+2, {PP_FUNCALL, PREC_FN, 0}},, so the next step is to grep for do_math3 (which also applies for dbeta, pbeta,..., qnbinom_mu). There is a connection to pbinom again in ./src/main/arithmetic.c (SEXP attribute_hidden do_math3): Math3_2(args, pbinom) is called. src/library/stats/src/distn.c then shows that Math3_2(args, pbinom) is called. Since we just already grepped for Math3_2, the trip ends here. So how can one find the source code of pbinom() in this case? Cheers, Marius On Wed, Aug 27, 2014 at 7:28 AM, Sarah Goslee sarah.gos...@gmail.com wrote: R FAQ 7.40 http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f Sarah On Tuesday, August 26, 2014, Marius Hofert marius.hof...@math.ethz.ch wrote: Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? Cheers, Marius -- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org __ R-help@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.
[R] Where to find source of C_pbinom?
Dear expeRts, I would like to find out how R computes pbinom(). A grep in the source code reveiled src/library/stats/R/distn.R:146: .External(C_pbinom, q, size, prob, lower.tail, log.p), so 'C_pbinom' refers to compiled C/C++ code loaded into R. Where can I find the source code of C_pbinom? Cheers, Marius __ R-help@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.