<commit_before># Calculate and Plot Local Extrema

This R package, `local.extrema`, consumes a numeric vector and derives the local extrema, or the peaks and valleys, for that vector.  Additionally, there is plotting capabilities to visualize the amplitude between minima and maxima.

## Overview 
The library contains two primary (usable) functions and a single set of demo data:
1. `extrema`: This function generates an S3 class, and accepts two arguments:
	1. `x`: the numeric vector that will used in the calculation.
	2. `interval`: the interval at which the extrema is calculated, i.e. how many observations. are considered before the next extrema can be considered.
2. `plot_extrema`:
	1. `x`: the S3 class generated by the `extrema` function.
	2. `ordinal_count`: an integer vector of the number of observations to visualize on the plot, i.e. if the vector length is 1M, you might only want to visualize 100.  A single length vector, when positive, will be interpreted as the first n values; when negative, will be interpreted as the last n values.  A double length vector will be interpreted as the start and end element ordinals in the vector.
3. `slv`: This is the preloaded demo data based on 100 days of stock ticker "SLV", the actual time frame is irrelevant.<commit_msg>denoted ordinal_count arguement is not ready in readme.md<commit_after># Calculate and Plot Local Extrema

This R package, `local.extrema`, consumes a numeric vector and derives the local extrema, or the peaks and valleys, for that vector.  Additionally, there is plotting capabilities to visualize the amplitude between minima and maxima.

## Overview 
The library contains two primary (usable) functions and a single set of demo data:
1. `extrema`: This function generates an S3 class, and accepts two arguments:
	1. `x`: the numeric vector that will used in the calculation.
	2. `interval`: the interval at which the extrema is calculated, i.e. how many observations. are considered before the next extrema can be considered.
2. `plot_extrema`:
	1. `x`: the S3 class generated by the `extrema` function.
	2. `ordinal_count`: an integer vector of the number of observations to visualize on the plot, i.e. if the vector length is 1M, you might only want to visualize 100.  A single length vector, when positive, will be interpreted as the first n values; when negative, will be interpreted as the last n values.  A double length vector will be interpreted as the start and end element ordinals in the vector - this arguement is not quite ready, sorry. :(
3. `slv`: This is the preloaded demo data based on 100 days of stock ticker "SLV", the actual time frame is irrelevant.
{'fraction_non_alphanumeric': 0.056766917293233084, 'fraction_numerical': 0.012030075187969926, 'mean_word_length': 4.397565922920893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1809727', 'n_tokens_mistral': 735, 'n_tokens_neox': 674, 'n_words': 423}