I'm working with R for some analysis, back at university I used to save my R script to a file without the output with notes in it.
I can't remember the command anymore! It was of the kind open to start printing to a file and close the printing when the work was done. This was very useful as I could separate the chuncks of commands, save in different files, only save what I needed, etc...
Here's an example of the output (.txt file)
df <- read.table ("albu_828614.txt", header = TRUE, na.strings = "NA")
str(df)
dim(df)
###################################
# Question #
###################################
###########
# Summary #
###########
summary (df[-c(5,6,7)]) # Summary of numerical variables
length(df$NE[df$NE == "1"])
length(df$COR[df$COR == "1"])
length(df$CUST[df$CUST == "1"])
#summary of categorical variables: number of variables 1 in each category
It is not the save history option, which saves every command in the console, as I could decide when to start and stop writing the file.