Saving Console in R Studio File

Hi, I am completely new to R and I am working on my first R project at my university. After I run my code it appears i the console, later when I save my file and close R Studio and reopen it the console gets reset and I need to run it again to get the output. However, our professor has asked us to upload the R file with the code + console in the same R file. Does the console gets rest every time I close my file? How can I work on this issue?

Yes, the console resets every time you start RStudio (and thus start a new R session). You can use the reprex package to embed the output as comments in the R source file.