Identifying observations shared by multiple tables
The list of data tables, gdp, is available in your workspace. Your goal is to find the countries that are located in more than one continent, i.e., rows that are present in more than one data.table in gdp.
Este ejercicio forma parte del curso
Joining Data with data.table in R
Instrucciones del ejercicio
- Use the
fintersect()(docs) function to build a newdata.tablecontaining countries located in both Europe and Asia. - Concatenate all
data.tables ingdpand assign it togdp_all. - Use the
duplicated()function to filtergdp_allto rows that are duplicates to find all countries located in more than one continent.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Obtain countries in both Asia and Europe
___
# Concatenate all data tables
gdp_all <- ___
# Find all countries that span multiple continents
___