Created
October 22, 2020 10:50
-
-
Save MonteShaffer/8555de33cec2b6ffff81c268bcccc041 to your computer and use it in GitHub Desktop.
R path to Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/64476043/ | |
# https://stackoverflow.com/questions/1189759/ | |
convertDirectoryR.toWin = function(myDir = getwd()) # "R:/data/state-capitals/final/" | |
{ | |
cat( normalizePath(myDir) ); | |
writeClipboard( normalizePath(myDir) ); # R:\data\state-capitals\final\ | |
} | |
openDirectoryR.inWin = function(myDir = getwd()) # "R:/data/state-capitals/final/" | |
{ | |
cmd = paste("explorer", gsub('/', '\\\\', myDir, fixed=TRUE ) ); | |
suppressWarnings( shell( cmd ) ); # R:\data\state-capitals\final\ | |
} | |
convertDirectoryWin.toR = function(myDir = readClipboard()) # # R:\data\state-capitals\final\ | |
{ | |
gsub('\\', '/', myDir, fixed=TRUE ); # "R:/data/state-capitals/final/" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment