What does <bytecode: 0x02b59ae4>
in below code mean ?
> nchar
function (x, type = "chars", allowNA = FALSE, keepNA = FALSE)
.Internal(nchar(x, type, allowNA, keepNA))
<bytecode: 0x02b59ae4>
<environment: namespace:base>`
is it useful for anything ?
The bytecode
statement indicates that the function has been byte compiled by the compiler
package. All base R functions are byte compiled. Byte compiled functions are almost always faster than the non-compiled version.
If a package has a ByteCompile: true
in its DESCRIPTION file, all functions in the package will be byte-compiled.
You can compile your own functions if you want:
f = function(x) x
f_cmp = compiler::cmpfun(f)
f
# function(x) x
f_cmp
# function(x) x
# <bytecode: 0x7f371a8>
Alternatively, you can set R_COMPILE_PKGS=3
in your .Renviron
and that will byte-compile package on installation. This assumes you are installing the package from source.
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