https://github.com/duncantl/RLLVMCompile
Raw File
Tip revision: 7fad5bd394a6f74ace0f6053a5d08e4f15cf3a1f authored by Duncan Temple Lang on 07 March 2017, 00:49:31 UTC
correct name for variable
Tip revision: 7fad5bd
cumsum.R
Cumsum =
  # This does the computation in line
function(x)
{
   for(i in 2:length(x))  # pardon the case where x is of length 1 or 0
     x[i] = x[i-1] + x[i]

   return(x) # don't need the return
}
back to top