How to construct the path to file in R

r

#1

I have a file mytest.R in working directory testdir but when I want to generate the path to file I am getting mytest.R

file.path(“mytest3.R”)
[1] “mytest3.R”


#2
file.path(getwd(), "mytest3.R")