-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from gongcastro/test
v1.0.1
- Loading branch information
Showing
12 changed files
with
70 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,37 @@ | ||
## code to prepare `pool` dataset goes here | ||
library(dplyr) | ||
library(tidyr) | ||
library(ipa) | ||
library(readxl) | ||
|
||
# uni lemmas | ||
worbank_lemmas <- read.delim( | ||
system.file("extdata/lemmas.txt", | ||
package = "bvq" | ||
), | ||
sep = "\t", | ||
quote = "" | ||
) %>% | ||
select(te, item, ends_with("lemma")) | ||
worbank_lemmas <- read.delim(system.file(file.path("extdata", "lemmas.txt"), | ||
package = "bvq"), | ||
sep = "\t", | ||
quote = "") %>% | ||
select(te, item, ends_with("lemma")) | ||
|
||
# import pool | ||
pool <- read_xlsx("inst/extdata/pool.xlsx") %>% | ||
left_join(worbank_lemmas, | ||
by = join_by(item, te) | ||
) %>% | ||
mutate( | ||
language = ifelse(grepl("cat_", item), | ||
"Catalan", | ||
"Spanish" | ||
), | ||
xsampa = ipa(ipa, "xsampa") | ||
) %>% | ||
select( | ||
item, language, te, label, xsampa, | ||
n_lemmas, is_multiword, subtlex_lemma, wordbank_lemma, | ||
childes_lemma, semantic_category, class, version, include | ||
) %>% | ||
drop_na(version) %>% | ||
mutate(across(c(te, n_lemmas), as.integer), | ||
across(c(is_multiword, include), as.logical), | ||
version = strsplit(version, split = ",") | ||
) | ||
pool <- system.file(file.path("extdata", "pool.xlsx"), | ||
package = "bvq") %>% | ||
read_xlsx() %>% | ||
left_join(worbank_lemmas, | ||
by = join_by(item, te)) %>% | ||
mutate(language = ifelse(grepl("cat_", item), | ||
"Catalan", | ||
"Spanish"), | ||
xsampa = ipa(ipa, "xsampa")) %>% | ||
select(item, language, te, label, xsampa, | ||
n_lemmas, is_multiword, subtlex_lemma, wordbank_lemma, | ||
childes_lemma, semantic_category, class, version, include) %>% | ||
drop_na(version) %>% | ||
mutate(across(c(te, n_lemmas), as.integer), | ||
across(c(is_multiword, include), as.logical), | ||
version = strsplit(version, split = ",")) | ||
|
||
# export for future testing | ||
saveRDS(pool, test_path("fixtures", "pool.rds")) | ||
saveRDS(pool, system.file(file.path("fixtures", "pool.rds"), | ||
package = "bvq")) | ||
|
||
# export pool database | ||
usethis::use_data(pool, overwrite = TRUE, internal = FALSE) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.