-
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 #27 from gongcastro/v0.4.0
Move to base R
- Loading branch information
Showing
41 changed files
with
528 additions
and
1,250 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,60 +1,60 @@ | ||
Package: bvq | ||
Title: Barcelona Vocabulary Questionnaire Database and Helper Functions | ||
Version: 0.3.2 | ||
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). 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 (>= 3.6.1), | ||
dplyr (>= 1.1.0), | ||
formr (>= 0.9.1), | ||
googlesheets4 (>= 1.0.0), | ||
janitor (>= 2.2.0), | ||
lifecycle (>= 1.0.3), | ||
lubridate (>= 1.8.0), | ||
magrittr (>= 2.0.3), | ||
rlang (>= 1.1.1), | ||
tibble (>= 3.2.1), | ||
tidyr (>= 1.2.0) | ||
Suggests: | ||
knitr, | ||
readxl, | ||
rmarkdown, | ||
roxygen2, | ||
testthat (>= 3.0.0), | ||
ggplot2 (>= 3.4.2), | ||
withr | ||
VignetteBuilder: | ||
knitr | ||
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.2 | ||
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). 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 (>= 3.6.1), | ||
dplyr (>= 1.1.0), | ||
formr (>= 0.9.1), | ||
googlesheets4 (>= 1.0.0), | ||
janitor (>= 2.2.0), | ||
lifecycle (>= 1.0.3), | ||
lubridate (>= 1.8.0), | ||
magrittr (>= 2.0.3), | ||
rlang (>= 1.1.1), | ||
tibble (>= 3.2.1), | ||
tidyr (>= 1.2.0) | ||
Suggests: | ||
knitr, | ||
readxl, | ||
rmarkdown, | ||
roxygen2, | ||
testthat (>= 3.0.0), | ||
ggplot2 (>= 3.4.2), | ||
withr | ||
VignetteBuilder: | ||
knitr | ||
Remotes: | ||
github::rubenarslan/formr | ||
Config/testthat/edition: 3 | ||
Encoding: UTF-8 | ||
Language: en-US | ||
LazyData: true | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.3 |
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 |
---|---|---|
|
@@ -25,60 +25,62 @@ | |
#' | ||
bvq_connect <- function(google_email = NULL, | ||
password = NULL) { | ||
formr_email <- "[email protected]" | ||
|
||
# ask for email in console is everything is NULL | ||
if (is.null(google_email)) google_email <- formr_email | ||
|
||
if (is.null(password)) { | ||
password <- Sys.getenv("FORMR_PWD", unset = NA) | ||
if (is.na(password)) { | ||
cli_abort("Please, provide a password") | ||
formr_email <- "[email protected]" | ||
|
||
# ask for email in console is everything is NULL | ||
if (is.null(google_email)) google_email <- formr_email | ||
|
||
if (is.null(password)) { | ||
password <- Sys.getenv("FORMR_PWD", unset = NA) | ||
if (is.na(password)) { | ||
cli_abort("Please, provide a password") | ||
} | ||
} | ||
} | ||
|
||
# if key exists, use it to log in | ||
tryCatch( | ||
suppressWarnings( | ||
formr_connect( | ||
email = formr_email, | ||
password = password, | ||
host = "https://formr.org/" | ||
) | ||
), | ||
error = function(e) { | ||
cli_abort( | ||
strwrap( | ||
prefix = " ", | ||
initial = "", | ||
"Could not connect to {.url https://formr.org/}. \ | ||
|
||
# if key exists, use it to log in | ||
tryCatch( | ||
suppressWarnings( | ||
formr::formr_connect( | ||
email = formr_email, | ||
password = password, | ||
host = "https://formr.org/" | ||
) | ||
), | ||
error = function(e) { | ||
cli_abort( | ||
strwrap( | ||
prefix = " ", | ||
initial = "", | ||
"Could not connect to {.url https://formr.org/}. \ | ||
Please check your internet connection or \ | ||
make sure you have set the right formr password." | ||
) | ||
) | ||
} | ||
) | ||
|
||
# check if Google credentials exists, ask for them if not | ||
if (!gs4_has_token()) { | ||
tryCatch( | ||
suppressWarnings(gs4_auth( | ||
email = google_email, | ||
token = Sys.getenv("GOOGLE_TOKEN", unset = NA) | ||
)), | ||
error = function(e) { | ||
cli_abort( | ||
strwrap( | ||
prefix = " ", | ||
initial = "", | ||
"Could not connect to Google.\ | ||
) | ||
) | ||
} | ||
) | ||
|
||
# check if Google credentials exists, ask for them if not | ||
if (!gs4_has_token()) { | ||
tryCatch( | ||
suppressWarnings({ | ||
googlesheets4::gs4_auth( | ||
email = google_email, | ||
token = Sys.getenv("GOOGLE_TOKEN", unset = NA) | ||
) | ||
}), | ||
error = function(e) { | ||
cli_abort( | ||
strwrap( | ||
prefix = " ", | ||
initial = "", | ||
"Could not connect to Google.\ | ||
Please check your internet connection or \ | ||
grant the necessary permissions." | ||
) | ||
) | ||
) | ||
} | ||
) | ||
} | ||
) | ||
} | ||
|
||
invisible(gs4_has_token()) | ||
} | ||
|
||
invisible(googlesheets4::gs4_has_token()) | ||
} |
Oops, something went wrong.