Skip to content

Commit

Permalink
Merge pull request #11 from gongcastro/test
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
gongcastro authored May 8, 2023
2 parents 1f90d72 + e3d4474 commit 675cbcc
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 91 deletions.
126 changes: 63 additions & 63 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
Package: bvq
Title: Barcelona Vocabulary Questionnaire Database and Helper Functions
Version: 0.2.0
Authors@R: c(
person(given = "Gonzalo", family = "Garcia-Castro",
email = "[email protected]",
role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-8553-4209")),
person(given = "Daniela S. ", family = "Ávila-Varela",
email = "[email protected]",
role = "aut",
comment = c(ORCID = "0000-0002-3518-8117")),
person(given = "Nuria",
family = "Sebastian-Galles",
email = "[email protected]",
role = "ctb",
comment = c(ORCID = "0000-0001-6938-2498")))
Maintainer: Gonzalo Garcia-Castro <[email protected]>
Description: Download, clean, and process the Barcelona Vocabulary
Questionnaire (BVQ) data. BVQ is a vocabulary inventory developed for
assesing the vocabulary of Catalan-Spanish bilinguals infants from the
Metropolitan Area of Barcelona (Spain), aged 10 to 40 months. This
package includes functions to download the data from formr servers,
and return the processed data in multiple formats.
License: MIT + file LICENSE
URL: https://gongcastro.github.io/bvq/,
https://github.com/gongcastro/bvq/
BugReports: https://github.com/gongcastro/bvq/issues
Depends:
R (>= 3.5.0),
Imports:
cli,
dplyr (>= 1.0.0),
formr (>= 0.9.1),
gargle,
googlesheets4,
janitor,
lifecycle,
lubridate,
magrittr,
rlang,
stringr,
tibble,
tidyr
Suggests:
knitr,
readxl,
rmarkdown,
roxygen2,
testthat (>= 3.0.0),
ggplot2 (>= 3.4.2),
withr
VignetteBuilder:
knitr,
ggplot2
Remotes:
github::rubenarslan/formr
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Package: bvq
Title: Barcelona Vocabulary Questionnaire Database and Helper Functions
Version: 0.3.0
Authors@R: c(
person(given = "Gonzalo", family = "Garcia-Castro",
email = "[email protected]",
role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-8553-4209")),
person(given = "Daniela S. ", family = "Ávila-Varela",
email = "[email protected]",
role = "aut",
comment = c(ORCID = "0000-0002-3518-8117")),
person(given = "Nuria",
family = "Sebastian-Galles",
email = "[email protected]",
role = "ctb",
comment = c(ORCID = "0000-0001-6938-2498")))
Maintainer: Gonzalo Garcia-Castro <[email protected]>
Description: Download, clean, and process the Barcelona Vocabulary
Questionnaire (BVQ) data. BVQ is a vocabulary inventory developed for
assesing the vocabulary of Catalan-Spanish bilinguals infants from the
Metropolitan Area of Barcelona (Spain), aged 10 to 40 months. This
package includes functions to download the data from formr servers,
and return the processed data in multiple formats.
License: MIT + file LICENSE
URL: https://gongcastro.github.io/bvq/,
https://github.com/gongcastro/bvq/
BugReports: https://github.com/gongcastro/bvq/issues
Depends:
R (>= 3.5.0),
Imports:
cli,
dplyr (>= 1.0.0),
formr (>= 0.9.1),
gargle,
googlesheets4,
janitor,
lifecycle,
lubridate,
magrittr,
rlang,
stringr,
tibble,
tidyr
Suggests:
knitr,
readxl,
rmarkdown,
roxygen2,
testthat (>= 3.0.0),
ggplot2 (>= 3.4.2),
withr
VignetteBuilder:
knitr,
ggplot2
Remotes:
github::rubenarslan/formr
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# bvq 0.3.0

* Add vignettes for `bvq_connect()`, `bvq_responses()`, `bvq_vocabulary()`, and `bvq_norms()`
* Fix citation
* Fix `.by` argument in `bvq_vocabulary()`
* Change base font in site

# bvq 0.2.0

* Package name changes from {bvqdev} to {bvq}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This package also contains multiple functions that extract the data and generate
From [r-universe](https://gongcastro.r-universe.dev/bvq) :rocket::

```r
install.packages('bvq', repos = c('https://gongcastro.r-universe.dev', 'https://cloud.r-project.org'))
install.packages('bvq', repos = 'https://gongcastro.r-universe.dev')
```

From the GitHub repository:
Expand Down
16 changes: 13 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,27 @@ template:
bg: "white"
fg: "black"
primary: "#003f5c"
base_font: {google: "Righteous"}
heading_font: {google: "Roboto Slab"}
base_font: {google: "Roboto"}
heading_font: {google: "Roboto"}
code_font: {google: "JetBrains Mono"}

lang: en

navbar:
structure:
left: [intro, reference, news]
left: [intro, reference, articles, news]
right: [search, github]
components:
articles:
menu:
- text: "Connecting to the database"
href: vignettes/bvq-responses.html
- text: "Retrieving raw data"
href: vignettes/bvq-responses.html
- text: "Vocabulary sizes"
href: vignettes/bvq-vocabulary.html
- text: "Word acquisition norms"
href: vignettes/bvq-norms.html
twitter:
icon: fa-twitter
href: http://twitter.com/gongcastro
Expand Down
23 changes: 18 additions & 5 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
citHeader("To cite bvqdev in publications use:")
citHeader("To cite bvq in publications use:")

citEntry(
entry = "Manual",
title = "bvq: A R package for retrieving vocabualry data from the Barcelona Vocabulary Questionnaire (BVQ)",
author = personList(as.person("Gonzalo Garcia-Castro")),
title = "bvq: Barcelona Vocabulary Questionnaire Database and Helper Functions",
author = personList(c(
person(given = "Gonzalo", family = "Garcia-Castro",
email = "[email protected]",
role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-8553-4209")),
person(given = "Daniela S. ", family = "Ávila-Varela",
email = "[email protected]",
role = "aut",
comment = c(ORCID = "0000-0002-3518-8117")),
person(given = "Nuria",
family = "Sebastian-Galles",
email = "[email protected]",
role = "ctb",
comment = c(ORCID = "0000-0001-6938-2498")))),
year = "2023",
snote = "R package version 1.0.1",
snote = "R package version 0.3.0",
url = "https://gongcastro.github.io/bvq",
textVersion = paste(
"G. Garcia-Castro (2023). bvq: A R package for retrieving vocabualry data from the Barcelona Vocabulary Questionnaire (BVQ). https://gongcastro.github.io/bvq"
"G. Garcia-Castro, D. S. Ávila-Varela, N. Sebastian-Galles (2023). bvq: Barcelona Vocabulary Questionnaire Database and Helper Functions. https://gongcastro.github.io/bvq"
)
)
4 changes: 2 additions & 2 deletions vignettes/bvq-connect.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Connecting to the database: `bvq_connect()`"
title: "Connecting to the database"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Connecting to the database: `bvq_connect()`}
%\VignetteIndexEntry{Connecting to the database}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
24 changes: 12 additions & 12 deletions vignettes/bvq-norms.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Word acquisition norms: `bvq_norms()`"
title: "Word acquisition norms"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Word acquisition norms: `bvq_norms()`}
%\VignetteIndexEntry{Word acquisition norms}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -12,25 +12,27 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
data("pool", package = "bvq")
```

The function `bvq_norms()` computes the proportion of children in the sample that understand or produce each item. This function returns the estimated probability of an average participant to understand or produce each item, and allows to condition this probability to the age, language profile or language dominance of participants. Proportions are adjusted for zero- and one-inflation following Gelman, Hill, and Vehtari (2020).
The function `bvq_norms()` computes the proportion of children in the sample that understand or produce each item, sometimes called "word prevalence". This function returns the estimated probability of an average participant understanding or producing each word. The `bvq_norms()` function allows to condition this probability on the age, language profile or language dominance of participants, among other variables. Proportions are adjusted for zero- and one-inflation following Gelman, Hill, and Vehtari (2020).

If argument `item` is left NULL (default), proportions are computed for all items (currently `nrow(pool)`). This may take time. If you need to compute norms for specific items, you can provide the item identifiers in the `item` argument. Available items can be consulted in the `pool` data set:
If argument `item` is left NULL (default), proportions are computed for all items (currently `r nrow(pool)`). This may take time. If you need to compute norms for specific items, you can provide the item identifiers in the `item` argument. Available items can be consulted in the `pool` data set:

```{r pool, echo=TRUE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(bvq)
head(pool)
```

Let's go through an example of how to use the `bvq_norms` function for a specific set of items.
Let's go through an example of how to use the `bvq_norms()` function for a specific set of items.

```{r responses, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(bvq)
# norms will be computed from these datasets
participants <- bvq_participants()
responses <- bvq_responses(participants = participants)
# items we want to compute norms for
my_items <- c("cat_gos", "cat_gat")
norms <- bvq_norms(
Expand Down Expand Up @@ -94,11 +96,9 @@ ggplot(norms,
scale_y_continuous(limits = c(0, 1)) +
scale_colour_manual(values = c("#003f5c", "#ff6361")) +
theme_minimal() +
theme(
axis.line = element_line(colour = "black"),
legend.position = "top",
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank()
)
theme(axis.line = element_line(colour = "black"),
legend.position = "top",
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank())
```
4 changes: 2 additions & 2 deletions vignettes/bvq-responses.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Retrieving raw responses: `bvq_responses()` and bvq_logs()"
title: "Retrieving raw data"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Retrieving raw responses: `bvq_responses()` and bvq_logs()}
%\VignetteIndexEntry{Retrieving raw data}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down
7 changes: 4 additions & 3 deletions vignettes/bvq-vocabulary.Rmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Vocabulary sizes: `bvq_vocabulary()`"
title: "Vocabulary sizes"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Vocabulary sizes: `bvq_vocabulary()`}
%\VignetteIndexEntry{Vocabulary sizes}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand All @@ -16,11 +16,12 @@ knitr::opts_chunk$set(

The `bvq_vocabulary()` function allows to extract vocabulary sizes for individual responses to any of the questionnaires. It takes the output of the `bvq_responses()` function as an argument, and returns several measures of vocabulary size base on such dataset.

To compute vocabulary size, we first need to run `bvq_responses()` (although it this argument is not provided, `bvq_responses()` is run under the hood):
To compute vocabulary size, we first need to run `bvq_responses()` (although if this argument is not provided, `bvq_responses()` is run under the hood):

```{r responses, echo=TRUE, eval=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(bvq)
# vocabularies will be computed from these datasets
participants <- bvq_participants()
responses <- bvq_responses(participants = participants)
Expand Down

0 comments on commit 675cbcc

Please sign in to comment.