forked from jazznbass/scan-Book
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_changes.qmd
More file actions
64 lines (45 loc) · 2.5 KB
/
app_changes.qmd
File metadata and controls
64 lines (45 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
title: Changes
---
## Important changes with version 0.53
### Single-case studies with cases of varying phase design
Sometimes it is necessary to combine single-cases with different phase-designs into one single-case study (for instance when some cases include an extension phase and others do not). Various functions in scan now can handle such a data structure.
### Piping
The concept of piping is great for writing clean and intelligible code that is easier to debug. We imported the pipe function `%>%` from the `magrittr` package. Since version 4.1, R has its own pipe operator implementation `|>`. This is great and works fine with the `scan` package. But since the `|>` Operator is not backwards compatible for R prior versions 4.1, we will stick with the `%>%` for a while.
To allow for smooth "piping" we began adding some functions `select_phases`, `subset`, `select_cases`, `set_var`, `set_dvar`, `set_mvar`, `set_pvar`, and `add_l2`.
## Important changes with version 0.50
### New function names
With version 0.50 scan introduced new names for its functions. The old function names are still usable but they will return a "deprecated" warning telling you to use the new function names.
@rtbl-aliases shows the changes.
```{r}
#| tbl-cap: Scan previous and current function names
#| echo: false
#| label: tbl-aliases
out <- tribble(
~"Current function name", ~"Previous function name",
"autocorr", "autocorrSC",
"corrected_tau", "corrected_tauSC",
"describe [since v0.52]", "describeSC",
"fill_missing", "fillmissingSC",
"outlier", "outlierSC",
"overlap", "overlapSC",
"power_test", "power_testSC",
"rand_test", "randSC; rand.test",
"ranks", "rankSC",
"rci", "rCi; rciSC",
"shift", "shiftSC",
"smooth_cases", "smoothSC",
"style_plot", "style.plotSC; style_plotSC",
"tau_u", "tauUSC",
"trend", "trendSC",
"truncate_phase", "truncateSC"
)
print_table(out)
```
### Change target variables in functions
All functions in R that analyze data now allow for temporarily changing dependent, phase, and measurement-time variables by adding three argument:
`dvar` sets the dependent variable.\
`pvar` sets the phase variable.\
`mvar` sets the measurement-time variable.
For example, `overlap(exampleAB_add, dvar = "depression")` will report overlap parameters for the variable *depression* while `overlap(exampleAB_add)` while take *wellbeing* as the dependent variable (as defined in the scdf).
After finishing the analysis, the variables are set back to their original values as defined in the scdf.