Created
May 30, 2016 02:50
-
-
Save Plaudenslager/3b52774aac61d4ad08146b508a23020b to your computer and use it in GitHub Desktop.
Remove extra headers in the data rows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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