Hi, I'm a new beginner of R.I want to use WDI to download global GDP per capita (constant 2015 US$) , like this figure. But I don't know how to define "country" in wdi. I only get all country of GDP, but I can't get a global data.
global_gdp<- WDI(indicator="NY.GDP.PCAP.KD",start=1990,end=2019)
Thank you so much,williaml.I know how to catch the country's data that I want by WDI package.The problem is that I want to figure out how can I ONLY catch the global average GDP per capita data,not only countries.
You can use the code 1W for example.
library(WDI)
gdp <- WDI(indicator = 'NY.GDP.PCAP.KD', country = "1W", start = 2010, end = 2020)
Or download everything then filter for what you want.
Thank you sooooooo much williaml ,you saved me!!!!! 
Hope you all good!!!!
Thank you so much ,williaml!!!You are great ,you solved my problem!