Last updated on 2025-12-28 03:51:23 CET.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 2025.11 | 18.15 | 212.30 | 230.45 | OK | |
| r-devel-linux-x86_64-debian-gcc | 2025.11 | 11.57 | 145.90 | 157.47 | OK | |
| r-devel-linux-x86_64-fedora-clang | 2025.11 | 34.00 | 348.87 | 382.87 | OK | |
| r-devel-linux-x86_64-fedora-gcc | 2025.11 | 34.00 | 350.76 | 384.76 | OK | |
| r-devel-windows-x86_64 | 2025.11 | 65.00 | 299.00 | 364.00 | ERROR | |
| r-patched-linux-x86_64 | 2025.11 | 18.69 | 195.37 | 214.06 | OK | |
| r-release-linux-x86_64 | 2025.11 | 17.79 | 194.36 | 212.15 | OK | |
| r-release-macos-arm64 | 2025.11 | 11.00 | 57.00 | 68.00 | OK | |
| r-release-macos-x86_64 | 2025.11 | 32.00 | 225.00 | 257.00 | OK | |
| r-release-windows-x86_64 | 2025.11 | 66.00 | 310.00 | 376.00 | OK | |
| r-oldrel-macos-arm64 | 2025.11 | 10.00 | 60.00 | 70.00 | OK | |
| r-oldrel-macos-x86_64 | 2025.11 | 33.00 | 260.00 | 293.00 | OK | |
| r-oldrel-windows-x86_64 | 2025.11 | 81.00 | 397.00 | 478.00 | OK |
Version: 2025.11
Check: examples
Result: ERROR
Running examples in 'bruceR-Ex.R' failed
The error most likely occurred in:
> ### Name: add
> ### Title: Create, modify, and delete variables.
> ### Aliases: add added
>
> ### ** Examples
>
> ## ====== Usage 1: add() ====== ##
>
> d = as.data.table(within.1)
> d$XYZ = 1:8
> d
ID A1 A2 A3 A4 XYZ
<char> <num> <num> <num> <num> <int>
1: S1 3 4 8 9 1
2: S2 6 6 9 8 2
3: S3 4 4 8 8 3
4: S4 3 2 7 7 4
5: S5 5 4 5 12 5
6: S6 7 5 6 13 6
7: S7 5 3 7 12 7
8: S8 2 3 6 11 8
>
> # add() does not change the raw data:
> add(d, {B = 1; C = 2})
ID A1 A2 A3 A4 XYZ B C
<char> <num> <num> <num> <num> <int> <num> <num>
1: S1 3 4 8 9 1 1 2
2: S2 6 6 9 8 2 1 2
3: S3 4 4 8 8 3 1 2
4: S4 3 2 7 7 4 1 2
5: S5 5 4 5 12 5 1 2
6: S6 7 5 6 13 6 1 2
7: S7 5 3 7 12 7 1 2
8: S8 2 3 6 11 8 1 2
> d
ID A1 A2 A3 A4 XYZ
<char> <num> <num> <num> <num> <int>
1: S1 3 4 8 9 1
2: S2 6 6 9 8 2
3: S3 4 4 8 8 3
4: S4 3 2 7 7 4
5: S5 5 4 5 12 5
6: S6 7 5 6 13 6
7: S7 5 3 7 12 7
8: S8 2 3 6 11 8
>
> # new data should be assigned to an object:
> d = d %>% add({
+ ID = str_extract(ID, "\\d") # modify a variable
+ XYZ = NULL # delete a variable
+ A = .mean("A", 1:4) # create a new variable
+ B = A * 4 # new variable is immediately available
+ C = 1 # never need ,/; at the end of any line
+ })
> d
ID A1 A2 A3 A4 A B C
<char> <num> <num> <num> <num> <num> <num> <num>
1: 1 3 4 8 9 6.00 24 1
2: 2 6 6 9 8 7.25 29 1
3: 3 4 4 8 8 6.00 24 1
4: 4 3 2 7 7 4.75 19 1
5: 5 5 4 5 12 6.50 26 1
6: 6 7 5 6 13 7.75 31 1
7: 7 5 3 7 12 6.75 27 1
8: 8 2 3 6 11 5.50 22 1
>
>
> ## ====== Usage 2: added() ====== ##
>
> d = as.data.table(within.1)
> d$XYZ = 1:8
> d
ID A1 A2 A3 A4 XYZ
<char> <num> <num> <num> <num> <int>
1: S1 3 4 8 9 1
2: S2 6 6 9 8 2
3: S3 4 4 8 8 3
4: S4 3 2 7 7 4
5: S5 5 4 5 12 5
6: S6 7 5 6 13 6
7: S7 5 3 7 12 7
8: S8 2 3 6 11 8
>
> # added() has already changed the raw data:
> added(d, {B = 1; C = 2})
> d
ID A1 A2 A3 A4 XYZ B C
<char> <num> <num> <num> <num> <int> <num> <num>
1: S1 3 4 8 9 1 1 2
2: S2 6 6 9 8 2 1 2
3: S3 4 4 8 8 3 1 2
4: S4 3 2 7 7 4 1 2
5: S5 5 4 5 12 5 1 2
6: S6 7 5 6 13 6 1 2
7: S7 5 3 7 12 7 1 2
8: S8 2 3 6 11 8 1 2
>
> # raw data has already become the new data:
> added(d, {
+ ID = str_extract(ID, "\\d")
+ XYZ = NULL
+ A = .mean("A", 1:4)
+ B = A * 4
+ C = 1
+ })
> d
ID A1 A2 A3 A4 B C A
<char> <num> <num> <num> <num> <num> <num> <num>
1: 1 3 4 8 9 24 1 6.00
2: 2 6 6 9 8 29 1 7.25
3: 3 4 4 8 8 24 1 6.00
4: 4 3 2 7 7 19 1 4.75
5: 5 5 4 5 12 26 1 6.50
6: 6 7 5 6 13 31 1 7.75
7: 7 5 3 7 12 27 1 6.75
8: 8 2 3 6 11 22 1 5.50
>
>
> ## ====== Using `when` and `by` ====== ##
>
> d = as.data.table(between.2)
> d
A B SCORE
<num> <num> <num>
1: 1 1 3
2: 1 1 6
3: 1 1 4
4: 1 1 3
5: 1 2 4
6: 1 2 6
7: 1 2 4
8: 1 2 2
9: 1 3 5
10: 1 3 7
11: 1 3 5
12: 1 3 2
13: 2 1 4
14: 2 1 5
15: 2 1 3
16: 2 1 3
17: 2 2 8
18: 2 2 9
19: 2 2 8
20: 2 2 7
21: 2 3 12
22: 2 3 13
23: 2 3 12
24: 2 3 11
A B SCORE
>
> added(d, {SCORE2 = SCORE - mean(SCORE)},
+ A == 1 & B %in% 1:2, # `when`: for what conditions
+ by=B) # `by`: by what groups
Error in `[.data.table`(data, A == 1 & B %in% 1:2, `:=`(SCORE2 = SCORE - :
attempt access index 3/3 in VECTOR_ELT
Calls: added -> eval -> eval -> [ -> [.data.table
Execution halted
Flavor: r-devel-windows-x86_64
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.