I have two folders (say \"A\",\"B\") which are in a folder (say \"Input\"). I want to copy \"A\" and \"B\" to another folder (say \"Output\"). Can I do this in R?
I am late. This is my simple approach that gets things done. In R,
current_folder <- "C:/Users/Bhabani2077/Desktop/Current"
new_folder <- "C:/Users/Bhabani2077/Desktop/Ins"
list_of_files <- list.files(current_folder, ".py$")
# ".py$" is the type of file you want to copy. Remove if copying all types of files.
file.copy(file.path(current_folder,list_of_files), new_folder)