I have financial data (CleanStocks.csv) that include sectors, companies, and their stock prices. I needed to find out find how many companies were in each sector so I did table(CleanStocks$Sector)
which gave me this:
Consumer Discretionary Consumer Staples Energy
55 25 6
Financials Health Care Industrials
60 35 52
Information Technology Materials Real Estate
39 20 27
Now I need to get sd(CleanStocks$Price)
and mean(CleanStock$Price)
for the companies in each of the sectors above into the table also and don't really know where to start, seems simple but I'm stuck