Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset path.expand on tilde

Tags:

r

On Windows, in my RProfile.site, I used to set:

Sys.setenv(R_USER="/my/desired/path/to/tilde")

However, this does not create the same effect on Ubuntu. Any ideas on how I can achieve the same effect? Such that when I type ~ in a path it expands to R_USER?

Here's an example. On Windows, after setting R_USER, in my scripts I would use the following:

read.csv("~/Project") 

Where "~" expanded to /some/path/to/projects/

like image 487
Brandon Bertelsen Avatar asked Jan 01 '26 19:01

Brandon Bertelsen


1 Answers

Define HOME="/my/projects/folder", preferably for R only, in .Renviron

Functionality for changing the method of ~ path expansion on windows does not exist in the same fashion as Windows as it does in Ubuntu/Linux*

like image 133
Dirk Eddelbuettel Avatar answered Jan 03 '26 12:01

Dirk Eddelbuettel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!