mdancho84/quantitative_stock_analysis_tutorial ? reverse-engineered prompt

Reverse engineered prompt

Build me an R script that analyzes S and P 500 stocks the way a quick quantitative stock screening tutorial would.

I want it to pull together a list of S and P 500 companies, get their price history, compute stock returns, and then calculate correlations so I can see which stocks move together. Please make it easy to run from one file, with clear steps and comments so I can follow along even if I am not deeply technical.

It would be great if the script also shows a simple example of sorting or screening the results, so I can quickly spot interesting stocks based on return performance and correlation. Keep it practical and focused on analysis, not a big app. If you need current package or data source details, look up the latest docs online and use whatever is most reliable.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab