Sorry for the title but it's hard to explain, I think with an example it's better.
Suppose I have a dataframe or another that shows me the amount of money information in different currencies for each person, a table like the one shown below:
df <- data.frame(NOMBRE=c('JUAN','JUAN', 'PEDRO', 'PEDRO', 'PEDRO', 'LUIS', 'LUIS'), MONEDA=c('EUR', 'USD', 'EUR', 'CLP', 'USD', 'GBP', 'EUR'), MONTO=c(10, 20, 30, 10, 20, 30, 10))
The problem is that I need to make a consolidated matrix with the coins as a column and where I look for the information for each different person based on the first dataframe. The aspect of this dataframe would be the following:
What I need is a function or something in R that allows me to fill in the information of what is shown in yellow
I'm a bit of a rookie in R and I have not found a similar question.
Thank you very much