In the above code, if I use,
row.names = NULL, the column data is shifting towards left .. For eg., Column1 data is shifting to row.names and so on, which leads to last column as empty.
row.names = 1, 'I'm getthing duplicate row.names error' (I do agree for this error, because, !st column has duplicate data...in fact all the columns have duplicate data)
I just want to copy data from CSV to dataframe as is. How can acheive it?
My CSV is in the following format :
COL1; COL2; COL3; COL4
abc;1234;test; test1
cde;1234;test2;test3
abc;5678;test;test1
in what way does it not work ?
Its not clear what uniqueness has to do with the aspect of simply transferring text data from disk and representing it as R data in memory, which seems to be the entirety of your question as posed.
Well, see, this must be because you are using a header with one less column than in your data (and you havent shared such an example header to us, or explained the logic behind that).
under those circumstances.
If there is a header and the first row contains one fewer field than the number of columns, the first column in the input is used for the row names
The implication is that rather than having example data that is like
a problem that matches the one discussed above, which was that you have a csv with 4 column headings, but only 3 columns of data. I suppose you should ask yourself if you know what each column should be called ?
some new problem, involving 3 columns that you read in, but crossed out the names of, and you havent said what your problem with these 3 columns are ?