gen_table: Participation of each predictive model in the best...

Usage Arguments Examples

View source: R/AzzortiAnalysis.R

Usage

1
gen_table(df_base)

Arguments

df_base

The data must be constituted as follows:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Headers
DF_TOTAL <- data.frame(CODI_CAMP = "",
                      NOMB_LINE = "",
                      CODI_VENT = "",
                      DESCRIPCION = "",
                      REAL = "",
                      Q_RG3 = "",
                      Q_MKT = "",
                      Q_30 = "",
                      Q_50 = "",
                      Q_70 = ""
)

DF_TOTAL<- DF_TOTAL[-c(1:nrow(DF_TOTAL)),]
campanas<- c(201901, 201902, 201903, 201904)

acumula<- DF_TOTAL

for(i in 1: length(campanas)) {
  #i=1
  acumula <- data.frame(CODI_CAMP = campanas[i],
                        NOMB_LINE = "RE ROPA EXTERIOR",
                        CODI_VENT = ceiling(runif(100,100000,999999)),
                        DESCRIPCION = paste0("P",c(1:100)),
                        REAL = 1000+(1:100)*10,
                        Q_RG3 = abs(1000+(1:100)*10 + rnorm(100,300,800)),
                        Q_MKT = abs(1000+(1:100)*10 + rnorm(100,100,700)),
                        Q_30 = abs(1000+(1:100)*10 + rnorm(100,400,700)),
                        Q_50 = abs(1000+(1:100)*10 + rnorm(100,450,900)),
                        Q_70 = abs(1000+(1:100)*10 + rnorm(100,700,900))
  )


  DF_TOTAL<- rbind(DF_TOTAL,acumula)
}

#
DF_TOTAL<-gen_q_besty(DF_TOTAL)
#
TABLA2<- gen_table(DF_TOTAL)

PaulLulo/AzzortiPackage documentation built on March 28, 2020, 12:55 a.m.