# DataTemporalMap-class

##### Class DataTemporalMap

Class `DataTemporalMap`

object contains the statistical distributions of data estimated at a
specific time period. Both relative and absolute frequencies are included.

##### Details

Objects of this class are generated automatically by the `estimateDataTemporalMap`

function,
but its construction and extension is open towards fostering its use through external methods.
E.g., one may use additional probability distribution estimation methods, or even construct
compatible DataTemporalMaps for other unstructured data such as images or free text.

##### Value

A `DataTemporalMap`

object.

##### Slots

`probabilityMap`

v-by-d numerical

`matrix`

representing the probability distribution temporal map (relative frequency).

`countsMap`

v-by-d numerical `matrix`

representing the counts temporal map
(absolute frequency).

`dates`

d-dimensional `Date`

array of the temporal batches.

`support`

v-by-1 numerical or character `matrix`

representing the support
(the value at each bin) of probabilityMap and countsMap.

`variableName`

name of the variable (character).

`variableType`

type of the variable (character) among "numeric", "character", "Date" and "factor".

`period`

batching period among "week", "month" and "year".

##### Examples

```
# NOT RUN {
# Generation through estimateDataTemporalMap function:
dataset <- read.csv2(system.file("extdata",
"nhdsSubset.csv",
package="EHRtemporalVariability"),
sep = ",",
header = TRUE,
na.strings = "",
colClasses = c( "character", "numeric", "factor",
"numeric" , rep( "factor", 22 ) ) )
datasetFormatted <- EHRtemporalVariability::formatDate(
input = dataset,
dateColumn = "date",
dateFormat = "%y/%m")
probMaps <- estimateDataTemporalMap(data = datasetPheWAS,
dateColumnName = "date",
period = "month")
class( probMaps[[1]] )
# Manual generation:
countsMatrix <- matrix(sample.int(25, size = 12*10, replace = TRUE), nrow = 12, ncol = 10)
probabilityMatrix <- sweep(countsMatrix,1,rowSums(countsMatrix),"/")
dates <- seq(Sys.Date(),(Sys.Date()+30*12),30)
x <- DataTemporalMap(probabilityMap = probabilityMatrix,
countsMap = countsMatrix, dates = dates, support = as.matrix(1:25),
variableName = "example", variableType = "numerical", period = "month")
# }
```

*Documentation reproduced from package EHRtemporalVariability, version 1.0, License: Apache License 2.0 | file LICENSE*