x c
1 1 1
2 2 2
Navigation
Press the right arrow key (→) to go to next puzzle. Press the down arrow key (↓) to incrementally reveal answer step by step.
Note
For all puzzles please assume that tidyverse
has been loaded.
↓ step by step answer
↓ step by step answer
tibble(
f = c(list(\(x) x + 1), list(\(x) x + 2)),
y = c(1,1)
) |>
rowwise() |>
mutate(g = list(\(x) f(x) + 1), x = g(y)) |>
pull(x) |>
sum()
↓ step by step answer
data.frame(
o = c(1,2,0,4),
c = paste0('(', 4:1),
data = tolower(LETTERS[1:4]),
mean = rep('+',4),
sum = rep('5*2,1)',4),
x = c('c', 'mean','data', 'sum')
) |>
rowwise() |>
mutate(y = list(get(x))) |>
arrange(o) |>
pull(y) |>
paste0(collapse = '') |>
parse(text=_) |>
eval() |>
sum()
↓ step by step answer
data.frame(
o = c(1,2,0,4),
c = paste0('(', 4:1),
data = tolower(LETTERS[1:4]),
mean = rep('+',4),
sum = rep('5*2,1)',4),
x = c('c', 'mean','data', 'sum')
) |>
rowwise()
# A tibble: 4 × 6
# Rowwise:
o c data mean sum x
<dbl> <chr> <chr> <chr> <chr> <chr>
1 1 (4 a + 5*2,1) c
2 2 (3 b + 5*2,1) mean
3 0 (2 c + 5*2,1) data
4 4 (1 d + 5*2,1) sum
data.frame(
o = c(1,2,0,4),
c = paste0('(', 4:1),
data = tolower(LETTERS[1:4]),
mean = rep('+',4),
sum = rep('5*2,1)',4),
x = c('c', 'mean','data', 'sum')
) |>
rowwise() |>
mutate(y = list(get(x)))
# A tibble: 4 × 7
# Rowwise:
o c data mean sum x y
<dbl> <chr> <chr> <chr> <chr> <chr> <list>
1 1 (4 a + 5*2,1) c <chr [1]>
2 2 (3 b + 5*2,1) mean <chr [1]>
3 0 (2 c + 5*2,1) data <chr [1]>
4 4 (1 d + 5*2,1) sum <chr [1]>
data.frame(
o = c(1,2,0,4),
c = paste0('(', 4:1),
data = tolower(LETTERS[1:4]),
mean = rep('+',4),
sum = rep('5*2,1)',4),
x = c('c', 'mean','data', 'sum')
) |>
rowwise() |>
mutate(y = list(get(x))) |>
arrange(o)
# A tibble: 4 × 7
# Rowwise:
o c data mean sum x y
<dbl> <chr> <chr> <chr> <chr> <chr> <list>
1 0 (2 c + 5*2,1) data <chr [1]>
2 1 (4 a + 5*2,1) c <chr [1]>
3 2 (3 b + 5*2,1) mean <chr [1]>
4 4 (1 d + 5*2,1) sum <chr [1]>
data.frame(
o = c(1,2,0,4),
c = paste0('(', 4:1),
data = tolower(LETTERS[1:4]),
mean = rep('+',4),
sum = rep('5*2,1)',4),
x = c('c', 'mean','data', 'sum')
) |>
rowwise() |>
mutate(y = list(get(x))) |>
arrange(o) |>
pull(y) |>
paste0(collapse = '') |>
parse(text=_) |>
eval() |>
sum()
[1] 15