How the world invests in R&D