calcul_ | R Documentation |
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).
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)
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. |
Les formules utilisees sont :
(data[,var1]/data[,var2])*100
((data[,var2]-data[,var1])/data[,var1])*100
((data[,var2]/data[,var1])^(1/nbAnnees)-1)*100
(data[,var]/sum(data[,var],na.rm = TRUE))*100
Retourne un objet data.frame.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.