Skip to content

Commit

Permalink
version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Patricia Zauchner committed Dec 6, 2024
1 parent 68c1793 commit 5632c46
Show file tree
Hide file tree
Showing 137 changed files with 9,200 additions and 2,159 deletions.
58 changes: 33 additions & 25 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
Package: gmoTree
Title: Get and Modify 'oTree' Data
Version: 1.2.0
Date: 2024-09-30
Version: 1.3.0
Date: 2024-12-06
Authors@R:
person(given = "Patricia F.", family = "Zauchner",
role = c("aut", "trl", "cre", "cph"),
email = "[email protected]",
comment = c("https://orcid.org/0000-0002-5938-1683", "University of Bremen"))
person("Patricia F.", "Zauchner", , "[email protected]", role = c("aut", "trl", "cre", "cph"),
comment = c(ORCID = "https://orcid.org/0000-0002-5938-1683", "University of Bremen"))
Description: Efficiently manage and process data from 'oTree' experiments.
Import 'oTree' data and clean them by using
functions that handle messy data, dropouts, and other problematic cases.
Create IDs, calculate the time, transfer
variables between app data frames, and delete sensitive information.
Review your experimental data prior to running
the experiment and automatically generate a detailed summary
of the variables used in your 'oTree' code.
Information on 'oTree' is found in Chen, D. L., Schonger, M., &
Wickens, C. (2016) <doi:10.1016/j.jbef.2015.12.001>.
Import 'oTree' data and clean them by using functions that handle
messy data, dropouts, and other problematic cases. Create IDs,
calculate the time, transfer variables between app data frames, and
delete sensitive information. Review your experimental data prior to
running the experiment and automatically generate a detailed summary
of the variables used in your 'oTree' code. Information on 'oTree' is
found in Chen, D. L., Schonger, M., & Wickens, C. (2016)
<doi:10.1016/j.jbef.2015.12.001>.
License: GPL (>= 3)
URL: https://zauchnerp.github.io/gmoTree/,
https://github.com/ZauchnerP/gmoTree/,
https://github.com/ZauchnerP/gmoTree
https://github.com/ZauchnerP/gmoTree/,
https://github.com/ZauchnerP/gmoTree
BugReports: https://github.com/ZauchnerP/gmoTree/issues
Depends: R (>= 4.4.0)
Imports: data.table (>= 1.15.4), dplyr (>= 1.1.4), knitr (>= 1.47),
openxlsx (>= 4.2.5.2), pander (>= 0.6.5), plyr (>= 1.8.9),
rlang (>= 1.1.4), rlist (>= 0.4.6.2), rmarkdown (>= 2.27),
stringr (>= 1.5.1)
Suggests: testthat (>= 3.2.1), withr (>= 3.0.0)
VignetteBuilder: knitr
Depends:
R (>= 4.4.0)
Imports:
data.table (>= 1.15.4),
dplyr (>= 1.1.4),
knitr (>= 1.47),
openxlsx (>= 4.2.5.2),
pander (>= 0.6.5),
plyr (>= 1.8.9),
rlang (>= 1.1.4),
rlist (>= 0.4.6.2),
rmarkdown (>= 2.27),
stringr (>= 1.5.1)
Suggests:
testthat (>= 3.2.1),
withr (>= 3.0.0)
VignetteBuilder:
knitr
BuildVignettes: true
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
NeedsCompilation: no
RoxygenNote: 7.3.2
33 changes: 31 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
**Changes in CITATION file and NEWS file are not documented.**
**Changes in CITATION file, NEWS file are not documented.**

# gmoTree 1.2.0
# gmoTree 1.3.0

* Changes in ```codebook()```
* Bug fixes
* Resolved an issue with ```Constants``` vector presentations in the output files
* Fixed incorrect handling of equal signs (```=```) in documentation
and choices.
* New arguments
* ```splitvarname``` to deal with long variable names. Caveat: In some cases, columns may still overlap. Control your output carefully.
* ```sep_list``` to decide on list presentation or newline presentation in the output file
* ```initial``` to include the initial values in the codebook
* Enhancements
* New preamble text
* ```output_format```
* Expanded the input possibilities for greater flexibility
* Changed default of ```output_format``` to ```pdf_document_simple```
* Improved handling of quotations
* Better presentations of quotations inside strings
* Quotation marks are now presented as straight and not smart form
* Removed non-escaped quotation marks from the output
* Improved list handling
* Values are now saved in list format and not as vectors
* Types of variables now correspond better to the types of the original variables
* Improved list presentation in output files for better readability
* Enhanced error and warning messages
* The function can now better deal better with empty arguments in the oTree code
* Linted older functions (more readable)
* Website changes

# gmoTree 1.2.1

* New function
* ```codebook()```: Create a codebook for the oTree code
Expand Down
19 changes: 9 additions & 10 deletions R/apptime.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ apptime <- function(oTree,
} else {
# If apps are defined, check if they are there
if (length(apps[apps %in% names(oTree)]) != length(apps)) {
if (length(apps[apps %in% names(oTree)]) > 0) {
if (length(apps[apps %in% names(oTree)]) > 0L) {
warning(
"The following app(s) is/are not in ",
"the list of oTree data frames: ",
Expand All @@ -110,7 +110,7 @@ apptime <- function(oTree,
}

# Seconds or minutes ####
if (seconds == TRUE) {
if (seconds) {
divsec <- 1L
} else {
divsec <- 60L # Divide seconds by 60 to get minutes
Expand All @@ -121,7 +121,7 @@ apptime <- function(oTree,
stop("There is no \"Time\" data frame.")
}

if (nrow(oTree$Time) == 0) {
if (nrow(oTree$Time) == 0L) {
stop("Your \"Time\" data frame is empty.")
}

Expand Down Expand Up @@ -492,7 +492,7 @@ apptime <- function(oTree,

duration <- duration / divsec

if (duration == 0) {
if (duration == 0L) {
duration <- NA
}

Expand Down Expand Up @@ -620,7 +620,7 @@ apptime <- function(oTree,
if (nrow(singledurations) == 0L) {

if (!is.null(duplicate_participants) &&
length(duplicate_participants) > 1) {
length(duplicate_participants) > 1L) {

# Duplicate data

Expand Down Expand Up @@ -726,7 +726,7 @@ apptime <- function(oTree,
output[["messages"]] <- unique(message_vector)
output[["first_app_one_page"]] <- firststageproblemparticipants

if (length(warningparticipants > 0L)) {
if (length(warningparticipants) > 0L) {
output[["warnings"]] <- unique(warningparticipants)
}

Expand Down Expand Up @@ -858,19 +858,18 @@ apptime <- function(oTree,
# Time for app for all participants ####
output <- all_time()

if (length(output) == 1 &&
if (length(output) == 1L &&
grepl("Durations not calculated", output)) {
next
}
}
}


if (!is.null(pcode)) {
if (length(onepersonnoapp) > 0) {
if (!is.null(pcode) && length(onepersonnoapp) > 0L) {
warning("Duration could not be calculated for the person in app(s): ",
paste(onepersonnoapp, collapse = ", "), ".")
}

}


Expand Down
4 changes: 2 additions & 2 deletions R/assignv_to_aaw.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ assignv_to_aaw <- function(oTree,

# Make indices
indices <- c(
1:which(names(oTree$all_apps_wide) == resafter),
1L:which(names(oTree$all_apps_wide) == resafter),
ncol(oTree$all_apps_wide), # Put the new variable here
(which(names(oTree$all_apps_wide) == resafter) + 1):
(which(names(oTree$all_apps_wide) == resafter) + 1L):
(ncol(oTree$all_apps_wide) - 1L)
)

Expand Down
Loading

0 comments on commit 5632c46

Please sign in to comment.