Dear all. Is it possible to convert.identify iso3 country names to the seven continent names? # Asia, Africa, Antarctica, Australia, Europe, South America, and North America, I have tried the following: ### region <- merge(countryExData,df,by.x='ISO3V10',by.y='iso3') where df is the name of my dataset with iso3 the identification variable but there seems to be a a lot of missing values. Thank you! Sincerely, Milu [[alternative HTML version deleted]]
> On Sep 7, 2017, at 11:36 AM, Miluji Sb <milujisb at gmail.com> wrote: > > Dear all. > > Is it possible to convert.identify iso3 country names to the seven > continent names? > > # Asia, Africa, Antarctica, Australia, Europe, South America, and North > America, > > I have tried the following: > > ### > region <- merge(countryExData,df,by.x='ISO3V10',by.y='iso3') > > where df is the name of my dataset with iso3 the identification variable > but there seems to be a a lot of missing values.Please provide a sufficient amount of the dataframe named `df` to allow a properly tested response.> > [[alternative HTML version deleted]]And do read the Posting Guide. This is a plain text mailing list.> > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA 'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
df is a data frame consisting of one variable (iso3 codes) such as USA RUS ARG BGD ITA FRA Some of these iso3 codes are repeated and I would like the corresponding continent name, the countrycode package does not seem to distinguish between North and South America. Thanks. Sincerely, Milu On Thu, Sep 7, 2017 at 9:00 PM, David Winsemius <dwinsemius at comcast.net> wrote:> > > On Sep 7, 2017, at 11:36 AM, Miluji Sb <milujisb at gmail.com> wrote: > > > > Dear all. > > > > Is it possible to convert.identify iso3 country names to the seven > > continent names? > > > > # Asia, Africa, Antarctica, Australia, Europe, South America, and North > > America, > > > > I have tried the following: > > > > ### > > region <- merge(countryExData,df,by.x='ISO3V10',by.y='iso3') > > > > where df is the name of my dataset with iso3 the identification variable > > but there seems to be a a lot of missing values. > > Please provide a sufficient amount of the dataframe named `df` to allow a > properly tested response. > > > > > [[alternative HTML version deleted]] > > And do read the Posting Guide. This is a plain text mailing list. > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > David Winsemius > Alameda, CA, USA > > 'Any technology distinguishable from magic is insufficiently advanced.' > -Gehm's Corollary to Clarke's Third Law > > > > > >[[alternative HTML version deleted]]
The unequivocal answer is that it is possible, and most likely you have bad data or are referring to an incomplete lookup table. For us to see what your problem is would rewquire a reproducible example, but what you have provided is not reproducible [1][2][3]. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) -- Sent from my phone. Please excuse my brevity. On September 7, 2017 11:36:05 AM PDT, Miluji Sb <milujisb at gmail.com> wrote:>Dear all. > >Is it possible to convert.identify iso3 country names to the seven >continent names? > ># Asia, Africa, Antarctica, Australia, Europe, South America, and North >America, > >I have tried the following: > >### >region <- merge(countryExData,df,by.x='ISO3V10',by.y='iso3') > >where df is the name of my dataset with iso3 the identification >variable >but there seems to be a a lot of missing values. > >Thank you! > >Sincerely, > >Milu > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.