Skip to content

Instantly share code, notes, and snippets.

@chainsawriot
Last active January 2, 2016 16:29
Show Gist options
  • Save chainsawriot/8330931 to your computer and use it in GitHub Desktop.
Save chainsawriot/8330931 to your computer and use it in GitHub Desktop.
Reading data with multiple comments The comment chars should not be those special regex characters.
### assuming the test.tab have this structure
# hello
# ! This is comment
# # This is also a comment
# 1
# 2
# 3
read.table(text=sub(paste0("[!#]", ".*"), "", readLines("test.tab")), header=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment