map() and nest() function help

I am having difficulty nesting time series data within an existing data frame. I have created a data frame (named "Full_List" in code) which has two columns and 638 rows. Each row is a different stock symbol that I am trying to get historical time series data on. What I would like to do is, create a third column in which the historical time series data for each stock symbol will be nested for each row and the corresponding stock symbol.

Running the below code adds the third column as I would like. However, each data entry in that column is returned with "NULL". Side note: I have successfully used the getsymbols() function to get the historical data I want (which returns an xts object for each stock symbol) for the stock symbols, but I am unable to figure out how to nest the returned xts objects within the original data frame.

Full_list <- Full_list %>% mutate(stock.prices = map(.x, getSymbols(.x)))

image

Any help on this would be greatly appreciated.

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.