I am trying to find the number of countries that have a certain type of industry.
Currently, I have this code:
countries = Flatten[CountryData[]];
listofCountries = Table[countries[[i]], {i, 1, 240}];
industries = Map[{CountryData[#, "MajorIndustries"]} &, CountryData[All]];
data = Table[industries[[i]] -> listofCountries[[i]], {i, 1, 240}];
I am not sure on how to find the number of countries that have an industry (i.e. Coal), or if I am headed in the correct direction.
Could somebody show me the correct way to find the number of countries with an industry?
EDIT: If I were trying to shade in the countries found on the world map with a color, how would I do so? (This is using the CountryData function.) I'm curious to see how much of the world has this industry, and so forth. (EDIT: How could I do it with the world map showing the boundaries of every country?)
EDIT 2: How could I do the edit above with two industries? (i.e. Coal and Copper)







MemberQbe easier thanNot[FreeQ[...]]? – kirma Oct 07 '13 at 08:16MemberQin myGraphicssection. Just felt like usingFreeQ– RunnyKine Oct 07 '13 at 08:17CountryData, then indeed Peru is included. So perhaps it's the way people who work with stats categorize things that isn't intuitive, it doesn't mean it's not correct/up to date The factbook puts copper in the mining category for Congo as well, but puts "copper mining" on its own for Zambia. – C. E. Oct 07 '13 at 12:33FullPolygonbrings back Alaska. – RunnyKine Oct 07 '13 at 17:29