Поворотная трансформация тибла? - PullRequest
0 голосов
/ 21 ноября 2018

У меня есть ...

# A tibble: 6 x 10
  CCG18CD   CCG18CDH CCG18NM                      STP18CD   STP18NM           LAD18CD   LAD18NM      PCON16CD PCON16NM        Dummy
  <chr>     <chr>    <chr>                        <chr>     <chr>             <chr>     <chr>        <chr>    <chr>           <dbl>
1 E38000035 07T      NHS City and Hackney CCG     E54000029 North East London E09000001 City of Lon~ E140006~ Cities of Lond~     1
2 E38000035 07T      NHS City and Hackney CCG     E54000029 North East London E09000001 City of Lon~ E140006~ Cities of Lond~     1
3 E38000035 07T      NHS City and Hackney CCG     E54000029 North East London E09000001 City of Lon~ E140006~ Cities of Lond~     1
4 E38000035 07T      NHS City and Hackney CCG     E54000029 North East London E09000001 City of Lon~ E140006~ Cities of Lond~     1
5 E38000004 07L      NHS Barking and Dagenham CCG E54000029 North East London E09000002 Barking and~ E140005~ Barking             1
6 E38000004 07L      NHS Barking and Dagenham CCG E54000029 North East London E09000002 Barking and~ E140005~ Barking             1

Я хочу выполнить поворотное преобразование столбца PCON16CD, используя:

* each distinct variable in this column/field taking a row of a new tibble

* columns generated from the variables in the current column CCG18CD

* Values being populated with a count of the column Dummy, with results shown as a percent of row total.

... то есть всеХлеб с маслом в Excel, но задача, которую я изо всех сил пытаюсь решить для R

...