Problem with read csv file in R from excel

51 Views Asked by At

I have a problem with loading csv files from excel in R. I am saving data (looks like this for example:

Patient Protein 1 Protein 2 Protein 3
P1 1.2 4.5 0
P2 4.0 6.2 0
P3 5.2 84.2 0.1
P4 30.1 79.2 52.3
P5 4.0 10.1 0.1
P6 0.8 3.6 0
P7 1.6 8.3 23.7
P8 5.5 10.0 0

) as a CSV file (*.csv) - file1.csv in the folder "data" on the desktop I then type the commands in R studio:

File = read.csv("C:\\Users\\Admin\\Desktop\\Data\\file1.csv", header = TRUE, sep = ",")
File

Instead of getting a file with column divisions I get data under the form: 8 obs. of 1 variable enter image description here

On the console it looks like this: enter image description here Significantly, previously as I saved the data in .csv format and I also load it now in R studio, it works without any problem. So most likely the problem is in saving from excel. I don't recall changing any settings in it. I don't know what could be the cause. Does anyone have any idea how to solve this?

I save the data the same way ( or at least I think it does) and load it as before. I don't know what happened, but it bothers me when running proteomic analyses. I would like it to load into R studio a file that generates 8 obs. of 4 variable. I will appreciate the help.

0

There are 0 best solutions below