Skip to content

Instantly share code, notes, and snippets.

@Plaudenslager
Created May 30, 2016 02:50
Show Gist options
  • Save Plaudenslager/3b52774aac61d4ad08146b508a23020b to your computer and use it in GitHub Desktop.
Save Plaudenslager/3b52774aac61d4ad08146b508a23020b to your computer and use it in GitHub Desktop.
Remove extra headers in the data rows
# Look for a duplicate header in the rows
header_in_rows <- startsWith(raw_data[,1], substr(colnames(raw_data)[1], 1, 5))
if(TRUE %in% header_in_rows){
print(raw_data[header_in_rows,])
raw_data <- filter(raw_data, !header_in_rows)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment