Construction of Lists of Symbols
as.symbols.Rd
as.symbols
and syms
are functions potentially useful
in connection with foreach
and xapply
.
as.symbols
produces a list of symbols from a character vector,
while syms
returns a list of symbols from symbols given as arguments,
but it can be used to construct patterns of symbols.
Value
A list of language symbols (results of as.symbol
- not graphical
symbols!).
Examples
as.symbols(letters[1:8])
#> [[1]]
#> a
#>
#> [[2]]
#> b
#>
#> [[3]]
#> c
#>
#> [[4]]
#> d
#>
#> [[5]]
#> e
#>
#> [[6]]
#> f
#>
#> [[7]]
#> g
#>
#> [[8]]
#> h
#>
syms("a",1:3,paste=TRUE)
#> [[1]]
#> a1
#>
#> [[2]]
#> a2
#>
#> [[3]]
#> a3
#>
sapply(syms("a",1:3,paste=TRUE),typeof)
#> [1] "symbol" "symbol" "symbol"