Final Project
Github repository: https://github.com/aishwaryashiv10/checkpoints
Often times I face the difficulty of not being able to save all my results from my R console to a file to refer back to it later. For this reason I created a package called 'checkpoints' to be able to save all the R script input as well as the console output. This package will be able to export the input and output into a document and will be updated each time you run or rerun a code. This document will also save a timestamp letting you know the exact time it was updated. I first started off by defining an object called my_function to log the console outputs into the log file. Then I created a logger function that takes two arguments: Msg(the message to log) and a file_name (the name of the log file). Inside the function, we use the cat function to append the message to the log file, along with the current date and time. I then created an on.Load function that sets the default log file name. I also created a sink function that saves the script and its console output to a file. I then created a Retrieving file that uses the getOption function to access the log file from your package. Overall this package would be very helpful to anyone trying to save their work from their console output while coding.
Comments
Post a Comment