Expand Data by Weight
expand(x, weight)
dataframe or matrix
weight column names or index
expanded data
# NOT RUN { df=data.frame(v=c(1,2,3), x=c(7,8,9), n=c(2,3,4)) expand(x = df,weight = 3) expand(x = df,weight = 'n') # }
Run the code above in your browser using DataCamp Workspace