Using the following code you can download and export the data to .csv format Packages needed: Quantmod , Time series Using the code you can downaload stock prices directly to R. ITs has 4 diffrent methods.
SulthanPhD/download-historical-stock-data-in-R
Using the following code you can download and export the data to .csv format
RGPL-3.0