Error code when using read.csv SOLVED
SOLVED
Hi
I am trying to load a csv file into R using the command
> Data<-read.csv("data.csv",header=T)
but I get the error code
Warning messages:
1: In if (!header) rlabp <- FALSE :
the condition has length > 1 and only the first element will be used
2: In if (header) { :
the condition has length > 1 and only the first element will be used
I've checked the directory is correct and I tried using the full file name F:\data.csv but that came up with the error code
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: '\P' is an unrecognized escape in a character string
2: '\d' is an unrecognized escape in a character string
3: unrecognized escapes removed from "F:\data.csv"
4: In file(file, "rt") :
cannot open file 'F:data.csv': No such file or directory
What am I doing wrong because I have copied this from an old code and it worked then?
SOLVED
Hi
I am trying to load a csv file into R using the command
> Data<-read.csv("data.csv",header=T)
but I get the error code
Warning messages:
1: In if (!header) rlabp <- FALSE :
the condition has length > 1 and only the first element will be used
2: In if (header) { :
the condition has length > 1 and only the first element will be used
I've checked the directory is correct and I tried using the full file name F:\data.csv but that came up with the error code
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: '\P' is an unrecognized escape in a character string
2: '\d' is an unrecognized escape in a character string
3: unrecognized escapes removed from "F:\data.csv"
4: In file(file, "rt") :
cannot open file 'F:data.csv': No such file or directory
What am I doing wrong because I have copied this from an old code and it worked then?
Last edited: