A work project has me bringing out R for the first time in over 2 years.
I have the code (redacted for privacy)
fromJSON("fake-api.com/test?date_from=202001010000Z&date_to=202001012359Z&limit=100")
I would like to iterate the UTC timecode inside that URL to gain 24 hours with each iteration, and have the JSON pulled from it to go into an object corresponding with the date.
My questions are:
How can I make an object for each day?
How can I iterate the dates in the URL to pull like this:
20200101 <- fromJSON("...?date_from=202001010000Z&date_to=202001012359Z&limit=100")
20200102 <- fromJSON("...?date_from=202001020000Z&date_to=202001022359Z&limit=100")
20200103 <- fromJSON("...?date_from=202001030000Z&date_to=202001032359Z&limit=100")
20200104 <- fromJSON("...?date_from=202001040000Z&date_to=202001042359Z&limit=100")
20200105 <- fromJSON("...?date_from=202001050000Z&date_to=202001052359Z&limit=100")
I am assuming it's a For Loop and some Regex, the former I have forgotten how to do, and the latter I never really knew.
Thank you for your help and advice!
Benjamin