r - Keeping the main name of column using dcast -
i have rows same name , want convert them columns keeping main name of column , add 1 or 2 etc. according how many columns exist.
i use make it:
setdt(df)[, n:= 1:.n, maincol] df <- dcast(df, url~n, value.var=c("stock"))
what expect have names stock_1, stock_2 etc. every column has number 1,2 etc. how can modify it?
Comments
Post a Comment