[R] How to automatically set R to read the files from a specific location

Avi Gross @v|gro@@ @end|ng |rom ver|zon@net
Thu Mar 3 02:08:10 CET 2022

Just a silly  thought, Paul. If this is really for a class and the file(s) being used are small enough, you can play a game where the data is already in the R program and is simply written into a file at the start in the current directory or a designated area. If that succeeds, you can then have the program start as if from scratch and read it back in and continue. 
An alternative if the file is not local but in a known place that can be reached, is code that copies it here ...
Of course in real life with existing huge files, not so much a good idea. But many programming assignments to students use smaller data sets. Some require having loaded a package and then have an access method to make the data visible and loaded. As long as the professor and others all have the same package, ...

-----Original Message-----
From: Paul Bernal <paulbernal07 using gmail.com>
To: R <r-help using r-project.org>
Sent: Wed, Mar 2, 2022 5:54 pm
Subject: [R] How to automatically set R to read the files from a specific location

Dear friends,

I am working on an assignment using R, and I would like to set my R code so
that R automatically recognizes where the files that need to be read are
without having to use the absolute path?
The idea is that when I send my .R script and my professor receives it, he
can just execute the code without running into any issues.

Thanks, beforehand, for your valuable feedback.


    [[alternative HTML version deleted]]

R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list