Skip to content
Prev 13683 / 15075 Next

I'm new to R in a Mac. How do I specify the path in read.table()?

Hi,

https://stat.ethz.ch/R-manual/R-devel/library/base/html/file.path.html

See the note at the bottom.  It's liberating in many ways that R handles
the underlying details for you - use the forward slash and you'll be good
to go without regard to the platform.

I think using file.path() is the best way to go. Just do something like the
following...

filename <- file.path("Users", "DFP",  "Desktop",  "Monroe319Ecoli.txt")
x <- read.table(filename)

Cheers,
Ben


On Mon, Feb 15, 2021 at 8:14 AM Parkhurst, David F. <parkhurs at indiana.edu>
wrote:

  
    
Message-ID: <CALrbzg1L=0Myyv8kM=vtbqthmNszn7bA73y4gGk7ffAX59Ndig@mail.gmail.com>
In-Reply-To: <BN7PR08MB4114B81A1F5DDE5E4D8866B6D0B99@BN7PR08MB4114.namprd08.prod.outlook.com>