R/play.r

Defines functions play

Documented in play

#' Play the recorded lazy operations
#' @param dataframe A data.frame
#' @param recordings A recording the expression, globals and packages using create_chunk_mapper
play <- function(dataframe, recordings) {
  for(recording in recordings) {
    tmp_env = list2env(recording$globals)
    
    # replace .disk.frame.chunk with dataframe in the function
    code = eval(bquote(substitute(.(recording$expr), list(.disk.frame.chunk=quote(dataframe)))))
    
    # execute the delayed function
    dataframe = eval(code, envir = tmp_env)
  }
  dataframe
}

Try the disk.frame package in your browser

Any scripts or data that you put into this service are public.

disk.frame documentation built on Aug. 24, 2023, 5:09 p.m.