I have a really large file that I would like to read in once and store in a data frame. Then I would like to reuse this file to create other smaller data frames files to run various models on these smaller data frames. Whenever there is output that's useful I want to detail and share with others by running another Knit.
If I close down my session and run the entire code including reading the large file and then Knit, it works. But if I then go back and adjust the code to create a new small data frame from the large data frame (without running the top chunk whose only job is to read in the large file (eval = FALSE)), then the 2nd attempt to knit bombs out. I get an error message that the smaller data frame that was created from the larger one can't be found.
Seems like this must be a very common issue but I'm not finding anything on the board how to structure the code to get this to work.