I'm trying to read in a text file (via read.table()
) which looks like this:
1#2#3
4#5#6
7#8#9
The "#" should be used as the field's seperator.
My code:
test_data <- read.table("a_test_file.csv", sep= "#")
I'm only able to read in the first column (the values 1,4,7). Is there something I don't see or any ideas concerning a workaround?
Edit: I just realize that # is used to insert coments which are not treated as code text. Could it be that this sign is kind of 'locked' for any other purposes than creating coments?
Set comment.char
to something else, e.g.:
test_data <- read.table("a_test_file.csv", sep = "#", comment.char = "")