-1

I want to know if it's possible to have this result:

exemple:

exemple

With this data frame

df
      y Faisceaux destination Trajet RED_Groupe Nbr observation RED       Pond Nbr observation total       RED        pct
1  2015        France DOM-TOM  Aller   78248.47                  87   85586.75                   307 0.9142591 0.04187815
2  2015         Hors Schengen  Aller  256817.64                 234  195561.26                  1194 1.3132337 0.06015340
3  2015         INTERNATIONAL  Aller  258534.78                 473  288856.53                  2065 0.8950283 0.04099727
4  2015               Maghreb  Aller  605514.45                 270  171718.14                  1130 3.5262113 0.16152007
5  2015              NATIONAL  Aller  361185.82                 923 1082529.19                  5541 0.3336500 0.01528302
6  2015              Schengen  Aller  312271.06                 940  505181.07                  4190 0.6181369 0.02831411
7  2015        France DOM-TOM Retour   30408.70                  23   29024.60                   108 1.0476871 0.04798989
8  2015         Hors Schengen Retour  349805.15                 225  168429.96                   953 2.0768583 0.09513165
9  2015         INTERNATIONAL Retour  193536.63                 138   99160.52                   678 1.9517509 0.08940104
10 2015               Maghreb Retour  302863.83                 110   41677.90                   294 7.2667735 0.33285861
11 2015              NATIONAL Retour  471520.80                 647  757258.33                  3956 0.6226684 0.02852167
12 2015              Schengen Retour  307691.66                 422  243204.76                  2104 1.2651548 0.05795112

without using Exel. With R or Python? I don't know if spliting column like that is possible.

M--
  • 25,431
  • 8
  • 61
  • 93
agreüs
  • 109
  • 11

1 Answers1

0

thanks to all the comment here my solution :

I split my data frame into two data frame df15 ( with 2015 data) and df16 (2016 data) then :

mytable15 <- tabular(Heading()*Faisceaux_destination ~ Trajet*(`RED_Groupe` + `Nbr observation RED` + Pond + `Nbr observation total` + RED + pct)*Heading()*(identity),data=df15)
mytable16 <- tabular(Heading()*Faisceaux_destination ~ Trajet*(`RED_Groupe` + `Nbr observation RED` + Pond + `Nbr observation total` + RED + pct)*Heading()*(identity),data=df16)
agreüs
  • 109
  • 11