1

I would like to read the source code for the base::sequence() function.

In R Studio, I can press F2, and usually read the code, though this time the cryptic response is:

function (nvec, ...) 
UseMethod("sequence")

I search the Read-only mirror of R source code at:

https://github.com/wch/r-source/search?q=sequence

And could not find the code there.

M.Viking
  • 5,067
  • 4
  • 17
  • 33

1 Answers1

2
sequence.default
function (nvec, from = 1L, by = 1L, ...) 
{
    .Internal(sequence(as.integer(nvec), as.integer(from), as.integer(by)))
}
<bytecode: 0x7ff50ed324b0>
<environment: namespace:base>

Then, the sequence function is internal and you can find the source code here: https://github.com/wch/r-source/blob/0a05488b8d2455983ac290a1804af0bf427d6475/src/main/seq.c#L1115

Eyayaw
  • 1,033
  • 5
  • 10