MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Joining Data with data.table in R

Lihat Kursus

Petunjuk latihan

  • Use the fintersect() (docs) function to build a new data.table containing countries located in both Europe and Asia.
  • Concatenate all data.tables in gdp and assign it to gdp_all.
  • Use the duplicated() function to filter gdp_all to rows that are duplicates to find all countries located in more than one continent.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Obtain countries in both Asia and Europe
___

# Concatenate all data tables
gdp_all <- ___

# Find all countries that span multiple continents
___
Edit dan Jalankan Kode