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.
You seem to have some typos
g <- read.csv.("cancer_data,"header=true,sep=",")
1. you have a '.' between 'csv' and '('.
2. you have flipped ',' and '"" in
'_data",header'
3. you write 'true', but R expects 'TRUE'
Try copying your code and errors into an LLM which should be able to
provide fixes.
On Sun, Mar 29, 2026 at 11:34?AM Li DiJulia <dijulia98 at gmail.com>
wrote:
> 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 at 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.
>
[[alternative HTML version deleted]]
Your file was not attached to your email
Try
g<-read. csv (" cancer_data", header=TRUE, sep= ',')
Also, you should consult the help files before posting.
John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
https://jcfrain.wordpress.com/
https://jcfraincv19.wordpress.com/
mailto:frainj at tcd.ie
mailto:frainj at gmail.com
On Sun 29 Mar 2026, 09:34 Li DiJulia, <dijulia98 at gmail.com> wrote:
> 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 at 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.
>
[[alternative HTML version deleted]]
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 g<-read.csv( "cancer_data", header= True, sep=','), I got this message: In file(file, "rt") : cannot open file 'Cancer_Data': No such file or directory. Thanks, Faith DiJulia On Sat, Mar 28, 2026 at 1:26?PM Li DiJulia <dijulia98 at gmail.com> wrote:> 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. > >
?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 at 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
1. Working directory message. The message ?The current active source is not
saved so does not have a directory to change into? appears when the script
you?re working in hasn?t been saved yet.
Once you save the script (File ? Save As), RStudio will allow you to set
the working directory normally.
2. File not appearing in the directory. The dataset was saved on your
computer as ?cancer data? without a file extension. RStudio won?t
recognize it as a CSV unless it ends in .
Renaming it to cancer_data.csv (or cancer data.csv) will make it show up
correctly.
3. Errors when running . The errors you received were caused by a few syntax
issues:
* Using instead of
* Including a trailing comma inside the filename
* Using instead of R?s required
* The file not having a extension
After correcting these, the proper command is:
This should load the dataset as long as the working directory is set to the
folder where the file is saved
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Li DiJulia
Sent: Saturday, March 28, 2026 12:27 PM
To: r-help at r-project.org
Subject: [R] Running CSV File
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 at 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.
On my computer, I saved the file as Cancer Data. csv. When I tried to put
the "Cancer Data.csv" in the working directory, under "source
file," it
says the currently active source file is not saved so doesn't have a
directory to change into. I also tried to put it in the "choose
directory"
and my file would not show. I am not sure what I am doing wrong.
When I tried to run the data set in R studio, I get unexpected symbol in
"g<-read.csv("cancer data.csv," header",despite writing
g<-read.csv
("cancer data.csv," header=TRUE, sep=',').
When I ran a Chi Square test, it said "object not found." I don't
know what
I am doing wrong
Thanks.
Attached are the files of the error message I am getting.
On Saturday, March 28, 2026, Li DiJulia <dijulia98 at gmail.com> wrote:
> 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.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cancer data csv.PNG
Type: image/png
Size: 4298 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20260329/ae549c47/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Chi Square test.PNG
Type: image/png
Size: 4155 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20260329/ae549c47/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CSV Read.PNG
Type: image/png
Size: 35235 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20260329/ae549c47/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Unexpected string.PNG
Type: image/png
Size: 40022 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20260329/ae549c47/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Working file.PNG
Type: image/png
Size: 45393 bytes
Desc: not available
URL:
<https://stat.ethz.ch/pipermail/r-help/attachments/20260329/ae549c47/attachment-0004.png>