Let’s use lapply to create a list l of 3 data.frames in which the first data.frame has it’s V2 column multiplied by 5, the second data.frame has V2 multiplied by 10, and the third has V2 multipled by 20. Use dat (see earlier slides) as the starting data.frame.
Within the lapply, write each data.frame out to tempdir, naming each dataX.csv, where X is replaced by the multiplier value applied to V2
Use list.dir() to read the file names and form a file path vector from them. Name the vector temp_files
Use lapply with temp_files to read the files back into a list l2. Compare l and l2 for equivalency.