To save a data frame to a file in R, use the save() function from the base package as follows:
This file will be saved in your current working directory.
To print the current working directory:
To set the working directory:
To load the saved data frame:
If you want to learn more about R programming watch this tutorial on Introduction to Data Science with R