I am trying to load a CSV file into a data frame but I am getting an error message.

After installing and loading packages this is the code that I am having problems with.

transactions <- read.csv("transactions.csv")

This is the message that I get:

" Error in read.table(file = file, header = header, sep = sep, quote = quote, :
duplicate 'row.names' are not allowed
In addition: Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls..."

and it goes on saying the same thing

It seems like your csv file is malformed or at least the column headers, can you provide a small sample of the raw content of the csv file?

1 Like

Yes sure. I am sorry, I am new to the community. I can't see to find how to upload a csv file in the comments.

You can't upload csv files here, you can either post the raw data as text or post a link to your file

1 Like

Hi @Mihalis_Karanikolas , try with tidyverse

transactions <- read_csv("transactions.csv") #
1 Like

It's all good now. I've been using RStudio Cloud all along . I then tried uploading the data on Google Sheets to share with you here but the dataset looked like the image I attached below and it wouldn't let me share.

I then tried using Desktop RStudio and I was able to import the data.
Thank you anyway!

Thank You!
I did try that previously but I had no luck :confused:

That is not a csv file but an excel file, they need different tools.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.