11.2 Save dat
You can easily save dat using the code shown below.
write.csv(dat, file = "where_do_you_want_to_save_it/filename")
The where_do_you_want_to_save_it indicates the directory to which you want to write the file and filename is the name of the new output. Note that if you omit including a directory, the file will be written to your current working directory. You can find it with the command getwd().