Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 445

Transform the value of column to number of rows in dataframe [duplicate]

$
0
0

I want to transform the column value to number of rows.

E.g.

data1|Month     | Number || --------| -------- || March   |       1  || April   |       2  || April   |       2  |

The output I want

|Month    | Number || --------| -------- || March   |       1  || April   |       1  || April   |       1  || April   |       1  || April   |       1  |

I tried running this script and got the error message below:

data1 %>%    ungroup %>%    uncount(Number)Error in `uncount()`:! `weights` can't be missing. Location ... is missing.

Viewing all articles
Browse latest Browse all 445

Trending Articles