grambank / rgrambank

R package to access and analyse Grambank's CLDF data
Apache License 2.0
4 stars 1 forks source link

new function: reduce dialects to language-level #1

Closed HedvigS closed 1 year ago

HedvigS commented 1 year ago

Here is a draft of a function that could be in this pacakge: https://github.com/HedvigS/personal-cookbook/blob/main/R/language_level_df.R

In cases where a dataset, like grambank, contains more than one dialect for the same language it reduces them to 1 per language. There are three different methods for this:

The current version just relies on there existing a wide value table with Language_ID in the environment. @xrotwang suggested re-writing it to take SQL input instead. I leave it up to @SimonGreenhill to decide how to proceed.

xrotwang commented 1 year ago

The package skeleton is here now, and here's the stub I could see for this function: https://github.com/grambank/rgrambank/blob/7ff7bdc857dc219d51bea73495556ec5887b10dc/R/db.R#L22-L28

HedvigS commented 1 year ago

Mamta could use a function of this kind in R.

xrotwang commented 1 year ago

@HedvigS feel free to implement whatever you think makes sense here. Just adapt function name and signature to whatever works for you.

HedvigS commented 1 year ago

@xrotwang Okay.

@SimonGreenhill would you like me to do a PR for this function?

HedvigS commented 1 year ago

This function, which exists in most recent state now in #12 could be in rcldf instead of rgrambank. Up to @SimonGreenhill . It takes cldf ValueTables, so technically can work on other types of cldf-datasets besides grambank.