0

I want to add numbers of the same Start while retaining the form of the dataframe. Below is how my dataframe looks currently.

'data.frame':   305897 obs. of  3 variables:
 $ Date  : int  20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 ...
 $ Start : chr  "ST-10" "ST-10" "ST-10" "ST-10" ...
 $ Number: int  1 1 2 1 1 1 1 1 2 1 ...

And below is what I want to make.

'data.frame':   14232 obs. of  3 variables:
 $ Date  : int  20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 20220701 ...
 $ Start : chr  "ST-10" "ST-1000" "ST-1002" "ST-351" ...
 $ Number: int  50 82 4 32 ...

I first tried using rbind cbind merge but those are not working; maybe since they're only for merging different dataframes? What am I supposed to do?

help
  • 1
  • 1
  • You're not adding columns, you're adding rows. The difference is important. – Limey Dec 03 '22 at 14:38
  • @Limey I don't think so... If I understood appropriately, isn't the link about combining 2 dataframes? I want to combine rows of one dataframe – help Dec 03 '22 at 14:46
  • Combining one data.frame makes no sense: it's already combined. Please follow the advice in [this post](https://stackoverflow.com/help/minimal-reproducible-example) to help you construct a *minimal reproducible example*. You'll need to post your input data frame(s) [preferably by using `dput()`] and your desired output based on that input. – Limey Dec 03 '22 at 14:50

0 Answers0