[R] Running CSV File

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sun Mar 29 16:21:40 CEST 2026


Às 17:26 de 28/03/2026, Li DiJulia escreveu:
> To whom it may concern,
> 
> I am trying to save this file "cancer data," which I have attached in this
> email, into working directory and when I click on "to source file location"
> under set working directory" it says- The current active source is not
> saved so does not have a directory to change into. I even clicked on
> "choose directory" under set working directory, my file still won't show
> up.
> 
> As for running data, When I downloaded the cancer data into R studio and
> ran g<-read. csv (" cancer_data," header=True, sep ','), I got this error
> message: *unexpected string consonant in g<-read. csv. (" cancer_data,"
> header=True, sep ',').*
> 
> Note: I saved the data in my computer as "cancer data." I am not sure what
> I am doing wrong. Please advise
> 
> When I tried this g<-read.csv. ("cancer_data," header=true, sep=",") I got
> this: in read.csv. ("cancer_data, header= true, sep=','):could not find
> function "read.csv". I am not sure what I am doing wrong. Please advise
> 
> 
> Thanks.
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hello,

There are many typos in your call to read.csv.
This should be the right way to read in the data.


g <- read.csv("cancer_data.csv", header = TRUE, sep = ',')


Try running


help("read.csv")


and see the correct way of calling read.csv and other similar functions.
You will find that read.table is the general purpose function to read 
tabular data, read.csv is a special case with some frequent defaults 
already set, including header=TRUE and sep=",". So, you can simply run


g <- read.csv("cancer_data.csv")   # header=TRUE and sep="," already set


hope this helps,

Rui Barradas



More information about the R-help mailing list