I want to create nested folders, I used dir.create() to create say /test1/project/code/example/ in current directory
cidr <- getwd()
mkfldr <- "/test1/project/code/example"
dir.create(cidr,mffldr)
but it generate like
Warning message: In dir.create(file.path(cidr, mkfldr)) : cannot create dir 'C:\Users\sharmb5\Documents\R script_RR\test1\project\code/example', reason 'No such file or directory'
and there is no creation of folders. If I use showWarning = FALSE, now it not giving the above warning but still not required folders are there.
suggest any method to create all these folders all in once instead of creating one by one.
Appreciations to your answer in advance!
recursive
argument ofdir.create
– Venettavenezia?dir.create
: "recursive: logical. Should elements of the path other than the last be created? If true, like the Unix command 'mkdir -p'." – Karolinerecursive
argument but it created folders up to \test1\project\code not entire path \test1\project\code/example which is required. – Dight