The goal of apr is to bring the goodness of APL to R. R provides multidimensional arrays out of the box, but many of the table stakes for array programming are missing. This package seeks to fill that gap.
APL Glyph Implementation Plan
The following sections group APL glyphs into categories and then list their corresponding monadic and dyadic function names in the apr package. Note: “—” indicates that the glyph does not have a standard monadic or dyadic form in APL.
Shape
- ⍴ (
apr_shape(),apr_reshape()) - ⍳ (
apr_iota(),apr_index_of()) - ↑ (
apr_first(),apr_take()) - ↓ (—,
apr_drop())
Structural
- ⍉ (
apr_transpose(),apr_transpose_axes()) - ⌽ (
apr_reverse(),apr_rotate()) - ⊖ (
apr_reverse_first(),apr_rotate_first()) - , (
apr_ravel(),apr_catenate()) - ⍪ (
apr_table(),apr_catenate_first())
Functional
- / (—,
apr_reduce()) - ⌿ (—,
apr_reduce_first()) - \ (
apr_expand(),apr_scan()) - ⍀ (
apr_expand_first(),apr_scan_first())
Set Operations
- ∊ (
apr_enlist(),apr_membership()) - ∩ (—,
apr_intersection()) - ∪ (
apr_unique(),apr_union())
Nesting
- ⊂ (
apr_enclose(),apr_partition()) - ⊃ (
apr_disclose(),apr_pick()) - ≡ (
apr_depth(),apr_match()) - ≢ (
apr_tally(),apr_not_match())
Arithmetic
- (
apr_conjugate(),apr_plus())
- (
- − (
apr_negate(),apr_minus()) - × (
apr_signum(),apr_times()) - ÷ (
apr_reciprocal(),apr_divide()) - | (
apr_abs(),apr_mod()) - (
apr_exp(),apr_power())
- (
Mathematical
- ⌈ (
apr_ceiling(),apr_max()) - ⌊ (
apr_floor(),apr_min()) - ○ (
apr_pi_times(),apr_circular()) - ⍟ (
apr_ln(),apr_log()) - ? (
apr_roll(),apr_deal())
Comparison
< (—,
apr_less())≤ (—,
apr_less_equal())= (—,
apr_equal())≥ (—,
apr_greater_equal())(—,
apr_greater())≠ (—,
apr_not_equal())