I am wondering how to read multiple datasets (CSV) into R and then perform the same functions on each dataset one at a time in a looping fashion. I don't know how to upload and show these datasets, however, I have attached a screenshot of what the data looks like. It is time-series data for various stocks. The files are all very similar to each other and are all in the same folder on my computer. If you guys need more information or a more in-depth explanation of the problem I am trying to solve please let me know! Thank you all.
What you are trying to achieve can easily be performed with functional programming. If you have never heard of this terminology, it is simply the action of applying the same function to several datasets in a sequential (looping) fashion without explicitly using a loop.
Could you upload a few of your datasets to a cloud system (e.g. Google Drive or Dropbox) and share it here? I'll help you write a code that will perform what you are looking for.
The main issue with the two datasets is that even though they look similar, they are not similar in the relevant ways. For example, both datasets have a date_time column; however, the first one is of the datetime class, but the second one is of the double (numeric) class. That's a problem, especially because the actions you are trying to perform on both datasets make use of this column.
The second issue is that the two datasets have different columns. This does not really affect the actions you specified above, but it may affect future actions. The first dataset has the "Hours" and "Dates" columns and the second dataset has the "correct_date_time" and "date" columns.
I can easily fix this; however, the code I will send you if I do will not be very effective. Could you please send me two datasets, which are similar so I can show you how to achieve your goal?