I have a data frame with the following columns:
**Columns Country Year Number_of_deaths**
**Data** US 2000 25
US 2001 30
UK 2000 30
UK 2001 21
I want to convert this to the following format:
**Columns: Country 2000 2001 2002 2003 2004**
**Data** US 25 30 35 40 25
UK 30 21 21 23 45
Can somebody give me sample code in R to do this? Any package is fine. Your help will be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…