ecl-logo Documentation

SequenceTake

SequenceTake[seq,n]out

returns the first n Monomers of the provided sequence.

SequenceTake[seq,-n]out

returns the last n Monomers of the provided sequence.

SequenceTake[seq,Span[n,m]]out

returns from the n-th to the m-th monomer of the provided sequence.

Details

    Input
    Output
    General Options

Examples

Basic Examples  (3)

Take 'n' Monomers from the front of a sequence:

Take 'n' Monomers from the back of a sequence:

Take 'n' though 'm' Monomers of a sequence:

Additional Examples  (2)

Works on explicitly typed sequences:

Works with numeric sequences as well:

Options  (6)

ExplicitlyTyped  (4)

Setting ExplicitlyTyped to True will ensure that the output is typed:

Setting ExplicitlyTyped to False will ensure that the output is not typed:

Setting ExplicitlyTyped to Automatic will type the output if the input is typed:

Setting ExplicitlyTyped to Automatic will type the output if the input is typed:

Polymer  (2)

Polymer option can be used to specificity the explicit typing:

Polymer option can be used to specificity the explicit typing:

Attributes  (2)

Listable  (2)

The function is listable across the input sequences:

The function is listable across 'n':

Messages  (1)

unmMatchLength  (1)

If input multiple sequences and indices but their lengths don't match, a message will throw:

Possible Issues  (1)

When ExplicitTyping is removed from numeric sequences, the degenerate monomer is used: