0

I have one data set with 61 variables.Last column have name Weight.So my intention is to replicate each row by the value of last column. For example if value is two, code need to copy this row by two times, if value is three then should copy three times etc.You can see small example of data set below.

  #DATA
      TEST<-data.frame(
            Value =c(8634,5798,6022),
            Income =c(8834,5898,6033),
            Weight =c(2,3,1))

enter image description here

So my intention is to transform table above, like table below.

enter image description here

So can anybody help me how to transform this table ?

silent_hunter
  • 2,224
  • 1
  • 12
  • 30
  • LOL, marked as a duplicate... and pointed to another question marked as duplicate :-) – January Jul 18 '19 at 13:03
  • 1
    @January That happens a lot...With the same questions being asked over and over again, and being answered, it's inevitable – Sotos Jul 18 '19 at 13:06

0 Answers0