#' @title Function \code{wrapper_function}
#' @description Wrapper function to call generate_data. \code{wrapper_function}
#' tests if \code{remake} keeps track of changes to nested functions.
#' @export
#' @return result of gendata
wrapper_function = function(){
generate_data()
}
#' @title Function \code{generate_data}
#' @description Generates some data.
#' @export
#' @return an unprocessed data frame
generate_data = function(){
data(mtcars)
n = dim(mtcars)[1]
mtcars$cyl = rpois(n, 5) # COMMENT/UNCOMMENT THIS LINE TO SEE HOW remake::make() RESPONDS
write.csv(mtcars, file = "data.csv")
}
#' @title Function \code{process_data}
#' @description Process some data generated by \code{generate_data}.
#' @export
#' @return data frame
#' @param filename file name of csv data
process_data = function(filename){
d = read.csv(filename)
data.frame(x = d$mpg, y = d$cyl)
}
#' @title Function \code{myplot}
#' @description make a plot
#' @export
#' @return plot
#' @param data data frame with fields x and y
myplot = function(data){
plot(y~x, data = data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.