Extracting stocks information

Hi all, good morning. I am trying to extract the stocks data for couple of companies. I have used below code to do for a company called Godrej.

library(quantmod)
require(quantmod)
df1 <- as.data.frame(getSymbols("GODREJIND.NS", src = "yahoo", from = "2018-01-01", to = Sys.Date(),verbose = F, auto.assign = T))
allstocks <- fortify.zoo(GODREJIND.NS)

But if I want to extract for more than 1 company at once. Is there a way to do it? What I planned was, I shall put all companies in an excel file like below and then calling it

image

Could anyone help me in extracting all companies stocks at once

Read the documentation for getSymbols(), you can pass a character vector with several symbol names.

Symbols a character vector specifying the names of each symbol to be loaded

If you need more specific help, please post a proper reprex, you already know that screenshots are not useful.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.