Skip to content
Prev 383110 / 398502 Next

project path in Rmd

Hello,

This is not an answer to the original problem, it's about '..'. (And a 
bit more.)

About '..', see if the following sequence of instructions can help.
Subdirectories '~/tmp' and '~/snap' exist on my PC, change to 
'~/analysis/scripts' or to what makes sense on yours.

od <- getwd()          # save this for later

setwd('~/tmp')         #
list.files('../snap')  # goes up one level and
                        # executes a SO/files related command
curr <- getwd()
basename(curr)         # these two instructions are meant to show that
dirname(curr)          # you don't need to know how many levels you have
                        # to go up, you can parse 'curr' if basename and
                        # dirname are not enough

setwd(od)              # back to where I was


Hope this helps,

Rui Barradas

?s 10:02 de 02/04/20, Ivan Calandra escreveu: