Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve documentation, add cross-ref #195

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions src/TSFrame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,33 @@

`::TSFrame` - A type to hold ordered data with an index.

A TSFrame object is essentially a `DataFrame` with a specific column marked
as an index. The input `DataFrame` is sorted during construction and
is stored under the property `coredata`. The index is stored in the
`Index` column of `coredata`.
A TSFrame object is essentially a
[DataFrame](https://dataframes.juliadata.org/) with a specific column
marked as an index. The first argument can accept a DataFrame, Vector,
or an Array with 2-dimensions. Any
[Tables.jl](https://github.com/JuliaData/Tables.jl) compatible table
is also accepted as an input.

If the first argument is a `DataFrame` then the DataFrame may contain
an indexing column also. The indexing column can be identified by
providing either the column number or the column name as `String` or
`Symbol` in the DataFrame as the second argument `index`.

In case, an indexing column is not present in the DataFrame then a
sequential index is created automatically.

The input `DataFrame` is sorted during construction and is stored
in the property `coredata`. The index is stored in the column
called `Index` of the `coredata` DataFrame. This index can be fetched
using the [`index()`](@ref) method.

Providing an empty DataFrame to the constructor results in a TSFrame
object with an empty index and no columns. Similarly, providing empty
Vector or empty Array as the first argument results in an empty
TSFrame with no columns.

Permitted data inputs to the constructors are `DataFrame`, `Vector`,
and 2-dimensional `Array`. If an index is already not present in the
constructor then a sequential integer index is created
automatically.
and 2-dimensional `Array`.

`TSFrame(coredata::DataFrame)`: Here, the constructor looks for a column
named `Index` in `coredata` as the index column, if this is not found
Expand Down
Loading