# 改檔案名稱 ###### tags: `R教學` `基礎教學` 練習檔案資料夾:[file_name](https://drive.google.com/drive/folders/1C-zKtZOJYFelmtR-1B0Uq_zoBEE6fMfu?usp=sharing) ```r= setwd(choose.dir()) ############# Location <- "file_name" dir_name <- "test" #####create a new folder lead_name <- "test" ##### ############# file <- list.files (Location,full.names = T) dir.create(dir_name) file.copy(from = file, to = dir_name) oldNames = list.files(dir_name, full.names = F) newNames = paste(lead_name,formatC(1:length(file), width = 3, flag = "0") ,".JPG",sep="") file.rename(from = file.path(dir_name, oldNames), to = file.path(dir_name, newNames)) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up