---
title: "Intro"
date: "`r format(Sys.Date(), '%d/%m/%Y')`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Intro}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

## Datasets

The basic object in Spada is a dataset. A dataset is an object of the data.frame class. Internally, for speed and programmability purposes, Spada uses the data.table class from the [**data.table**](https://rdatatable.gitlab.io/data.table/) package.

Spada demands at least one dataset. If none is provided in the funcion call then Iris and Mtcars, from datasets package, are used as sample data.

```{r, eval = FALSE}
library(spada)
spada()
```

For multiples datasets as input:

```{r, eval = FALSE}
spada(iris, mtcars, cars)
```

### Dataset Names

If the user desires to give names to datasets, then the Spada function should be called like this:

```{r, eval = FALSE}
spada('dataset' = iris, 'test_data' = mtcars)
```

Spada will make valid and unique names with **make.names** function. So:

```{r, eval = FALSE}
spada('dataset 1' = iris, 'test data' = mtcars, 'dataset 1' = cars)
```

Will result in names: dataset.1, test.data and dataset.1.1.

If the user inform at least one name, Spada will assume that the datasets should receive a name (instead the name of the original object) and **will create valid and unique names** using dataset_n, being n a sequencial number:

```{r, eval = FALSE}
spada('dataset 1' = iris, mtcars, cars)
```

Will result in names: dataset.1, dataset_2 and dataset_3.

### Active Dataset

The dataset in which the operations will be applied are the **Active dataset**. One can think of this dataset as the current object. As Spada requires at least one dataset, won't be possible to delete the Active dataset.

## Navbar

Spada uses a page_navbar from bslib package. In the left side are the menus that lead to the app pages. In the right side are the **Active dataset** name.

![](../man/figures/articles/spada/navbar_active_dataset.png)

## Navbar Menus

### Data

This is the default selected item.

#### Highlights

![](../man/figures/articles/spada/data_menu/highlights.png)

#### Metadata

![](../man/figures/articles/spada/data_menu/metadata.png)

#### Overview

![](../man/figures/articles/spada/data_menu/overview.png)

#### Data

![](../man/figures/articles/spada/data_menu/data.png)

#### Import

![](../man/figures/articles/spada/data_menu/import.png)

#### Export

![](../man/figures/articles/spada/data_menu/export.png)

### Edit

![](../man/figures/articles/spada/spada_edit.png)

### Analysis

![](../man/figures/articles/spada/spada_analysis_exploratory.png)

### Output

![](../man/figures/articles/spada/spada_output.png)

### Config

![](../man/figures/articles/spada/spada_config.png)
