create directory r code example Example: r make directory dir.create(file.path(mainDir, subDir), showWarnings = FALSE)