Skip to content

Instantly share code, notes, and snippets.

@Dulani
Created January 27, 2015 16:29
Show Gist options
  • Save Dulani/ffef9389dbe460078c90 to your computer and use it in GitHub Desktop.
Save Dulani/ffef9389dbe460078c90 to your computer and use it in GitHub Desktop.
Excel style "fill down" in R using data.table
#An Excel style "fill down" for Data Table. (.SD is the Subset of Data for each 'by' group)
dataTable[,setId:=.SD[1,setId],by=setNum] #TAG:USEFUL (Excel style fill down)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment