# using bind_rows
head(bind_rows(one = cars,
two = cars,
.id = "anything"))
#> Error in bind_rows(one = cars, two = cars, .id = "anything"): could not find function "bind_rows"
tail(bind_rows(one = cars, two = cars, .id = "anything"))
#> Error in bind_rows(one = cars, two = cars, .id = "anything"): could not find function "bind_rows"
purrr::map2_df(.x = list(one = 1, two = 50, three = 100),
.y = list(one = 10,two = 2, three = 1),
.f = ~rnorm(n = 10,
mean = .x,
sd = .y))
#> # A tibble: 10 x 3
#> one two three
#> <dbl> <dbl> <dbl>
#> 1 -5.56 48.1 101.
#> 2 -15.6 51.8 97.5
#> 3 -3.68 48.4 99.5
#> 4 5.89 46.1 101.
#> 5 -6.91 49.6 100.
#> 6 -8.52 50.8 100.
#> 7 -3.57 51.6 99.8
#> 8 6.91 45.0 100.
#> 9 -25.1 49.5 101.
#> 10 12.3 50.0 100.
purrr::pmap(.l = list(mean = list(1, 50, 100),
sd = list(10, 2, 1),
n = list(1,2,10)),
.f = rnorm)
#> [[1]]
#> [1] 13.48273
#>
#> [[2]]
#> [1] 50.45065 50.71595
#>
#> [[3]]
#> [1] 99.40228 100.09047 101.49171 98.55780 100.61768 98.88516 102.12961
#> [8] 100.78080 98.97738 99.54191
Created on 2020-09-18 by the reprex package (v0.3.0)