I am learning programming in R language and want to learn storage basics. I have created an R script that gets data from Google Analytics API and stores it in a local dataframe (on my own computer) to be able to apply new treatments to data. Now I'm looking for the right way to store this data on Google Cloud Storage to be able to access this data when I want.
These are the steps I imagine :
THE FIRST TIME I RUN THE SCRIPT
- Get data from Google Analytics API and put it to a dataframe in R
- Save this dataframe in .csv format (my_df.csv)
- Send this csv to Google Cloud Storage
THE SECOND TIME (AND NEXTS) WHEN I WILL RUN THE SCRIPT
- Get my_df.csv from Google Cloud Storage
- Get data from Google Analytics API and put it to a dataframe in R (new_df.csv)
- Merge new_df.csv and my_df.csv
- Save this merged dataset as my_df.csv
- Send my_df.csv to Google Cloud Storage (this way, it will replace the my_df.csv current version)
Is there a better way to do this?
Thanks in advance for your advices!