Last active
January 2, 2016 16:29
-
-
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.
This file contains hidden or 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
| ### 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