calcul_variable_classes: Calculating a class variable

Description Usage Arguments Details Value Examples

Description

Add to a data table a column whose values can be represented in a class analysis (ratio, part, evolution ...).

The calculation is based on volume data (from the population, for example).

Usage

1
2
3
4
5
6
7
8
9
calcul_ratio(data, var1, var2)

calcul_tx_evol_global(data, var1, var2)

calcul_tx_evol_ann_moy(data, var1, var2, nbAnnees)

calcul_part_ens(data, var)

calculette(data, formule = NULL)

Arguments

data

tableau de donnees (data.frame).

var1

chaine de caracteres (character). Variable en volume de la table.

var2

chaine de caracteres (character). Variable en volume de la table.

nbAnnees

nombre (numeric). Nombre d'annees appliquable au taux d'evolution annuel moyen.

var

chaine de caracteres (character). Variable en volume de la table.

formule

chaine de caracteres (character). Formule libre pour le calcul d'une variable de classes. Seuls les caracteres + - * / ^ ( ) sont acceptes.

Details

Les formules utilisees sont :

ratio

(data[,var1]/data[,var2])*100

tx_evol_global

((data[,var2]-data[,var1])/data[,var1])*100

tx_evol_ann_moy

((data[,var2]/data[,var1])^(1/nbAnnees)-1)*100

part_ens

(data[,var]/sum(data[,var],na.rm = TRUE))*100

Value

Retourne un objet data.frame.

Examples

1
2
3
4
5
6
7
data("donnees_monoloc")

ratio <- calcul_ratio(data = donnees_monoloc, var1 = "POP_2010", var2 = "POP_2015")
teg <- calcul_tx_evol_global(data = donnees_monoloc, var1 = "POP_2010", var2 = "POP_2015")
team <- calcul_tx_evol_ann_moy(data = donnees_monoloc, var1 = "POP_2010", var2 = "POP_2015",
nbAnnees = 5)
part <- calcul_part_ens(data = donnees_monoloc, var = "POP_2015")

oceanis documentation built on Aug. 23, 2019, 5:04 p.m.