glottolog / glottolog-cldf

Glottolog data as CLDF StructureDataset
https://glottolog.org
Creative Commons Attribution 4.0 International
13 stars 3 forks source link

Would be helpful to have family name somewhere (languages.csv) #2

Closed SimonGreenhill closed 4 years ago

xrotwang commented 4 years ago

That's just a self-join of languages.csv on Family_ID away!

Simon J Greenhill notifications@github.com schrieb am Mi., 18. Sep. 2019, 13:55:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/glottolog/glottolog-cldf/issues/2?email_source=notifications&email_token=AAGUOKHKJCNH7NJC7YLJUY3QKIJLZA5CNFSM4IX5UD62YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HMD2K6A, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGUOKDL2YB2QBKICLWVBOLQKIJLZANCNFSM4IX5UD6Q .

SimonGreenhill commented 4 years ago

Ahh, of course! thanks!

SimonGreenhill commented 4 years ago

...and in case a future R user wants to solve this problem:

languages <- read.csv("languages.csv", header=TRUE)

languages <- merge(
   languages[c('ID', 'Family_ID', 'Name')],
   languages,
   by.x="Family_ID", by.y="ID",
   all.x=TRUE, 
   suffixes=c(".Language", ".Family")
)