Coerces an object to an list. All attributes are removed except any names.
Examples
as_list(1:3)
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] 2
#>
#> [[3]]
#> [1] 3
#>
as_list(c(x = 1, y = 2))
#> $x
#> [1] 1
#>
#> $y
#> [1] 2
#>
Coerces an object to an list. All attributes are removed except any names.
as_list(1:3)
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] 2
#>
#> [[3]]
#> [1] 3
#>
as_list(c(x = 1, y = 2))
#> $x
#> [1] 1
#>
#> $y
#> [1] 2
#>