0

I have a dataset with 3 fields id|FeatureName|Volume of feature

id  log_feature volume
6597    feature 68  6
8011    feature 68  7
2597    feature 68  1
5022    feature 172 2
5022    feature 56  1
5022    feature 193 4
5022    feature 71  3
6852    feature 201 2
6852    feature 56  1

I have to convert this dataset from rows to columns ie

id  volume1 feature 1   Volume 172 feature 172  Volume 56 feature 56    ...
5022|0  |0    |2  | 1 | 1 |1 .....

ie the resulting data set should have one row per id ,volume given is that of the feature next to it . In the sample above i have taken the example of id=5022 but the column in the result dataset will contain ALL the columns possible in source data set and corresponding volume. How can i achieve this in R -Please help

Bak_was
  • 45
  • 2
  • 8

0 Answers0