I am new to R and I ran into a piece of code that I do not understand. More specifically, I would like to know what .Internal
does. Here is an example that I am trying to convert to Matlab:
dunif <- function (x, min = 0, max = 1, log = FALSE)
.Internal(dunif(x, min, max, log))
<environment: namespace:stats>
I would like to know what .Internal
and <environment ... >
do.
Thank you much in advance, Simon
Python and R are both free, open-source languages that can run on Windows, macOS, and Linux. Both can handle just about any data analysis task, and both are considered relatively easy languages to learn, especially for beginners.
Yes. At Dataquest, we've had many learners start with no coding experience and go on to get jobs as data analysts, data scientists, and data engineers. R is a great language for programming beginners to learn, and you don't need any prior experience with code to pick it up.
From ?.Internal
:
‘.Internal’ performs a call to an internal code which is built in
to the R interpreter.
You'll find the code for dunif
in the R sources. I find this type of function via a grep for it in main/names.c
then grep for the name it refers to (do_math3
in this case), which you will find in main/arithmetic.c
.
<environment: namespace:stats>
simply tells you the location / namespace of the function.
I found R in a Nutshell a useful resource to explain objects and environments in a non-intimidating way. It is worth a look.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With