data i have
id <- c(1,1,1,2,2,3,3,4,4,4,5,5)
wt <- c(10,10,20,15,15,10,15,15,15,10,20,15)
df <- data.frame(id,wt)
data i want
bwt <- c(10,10,10,15,15,10,10,15,15,15,20,20)
df2 <- data.frame(id,wt,bwt)
I want to add a new column bwt to dataset df, new column is just the first row of column wt of perticular id