I am trying to read the simplest of csv files but there seems to be a problem when trying to convert the data to numerical. This is the minimal code and output:
initialsoltext=read.csv('initialsol.txt', header = FALSE, sep = "")
initialsoltext
output: V1 V2 V3 V4 V5 V6 V7 V8 V9 V10
1 [1 0 0 0 0 1 0 0 1 0]
as.numeric(initialsoltext)
output: [1] 1 0 0 0 0 1 0 0 1 1
The csv file is not the issue since the text is read properly - what can possibly happen during the conversion of the last 0? I tried replacing the "[" and "]" thinking that maybe the last bracket was read as a 1 but it doesn't make a difference. Thanks to anyone who can help,