create folder in r

# Step 1: Set the path for the new folder
folder_path <- "C:/your/desired/path"

# Step 2: Create the new folder
dir.create(folder_path)

# Step 3: Check if the folder was created successfully
if (file.exists(folder_path)) {
  print("Folder created successfully.")
} else {
  print("Error creating folder.")
}