Skip to content

Automates file and folder copying in R for reproducible workflows and cross-project data updates

License

Notifications You must be signed in to change notification settings

dertristan/copyR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

copyR — A Tiny File Copy Helper

Quick summary:
This R script automates file or folder copying — handy when you regularly pull updated data or resources from another project.
Instead of manually dragging files around, just run this script and it’ll take care of the copying for you.

💡 Rule of thumb: If you’ve copied the same file or folder three or more times, it’s officially time to automate it.


How to use:

  1. Open the script and set the two paths:

    # Source (the file or folder you want to copy)
    source_file_path <- "PATH_TO_FILE(S)_OR_FOLDER(S)_TO_COPY"
    
    # Destination (the folder where you want to place the copy)
    destination_folder_path <- "PATH_TO_FOLDER_TO_BE_COPIED_INTO"

    ⚠️ Use forward slashes (/) in paths — even on Windows — or double backslashes (\\).

  2. Run the script in R (or source("copyR.R") in your project).
    The script will:

    • Copy the specified file(s) or folder(s) to the destination
    • Overwrite existing files if they already exist
    • Print a success or error message in the console
  3. If the copy fails, check:

    • That the source file or folder exists
    • That the destination folder path is correct
    • That you have the necessary write permissions

Example use case:
You have a data project that depends on a dataset from another repo.
When the dataset gets updated, just run:

source("copyR.R")

and your local copy will stay up to date automatically.

About

Automates file and folder copying in R for reproducible workflows and cross-project data updates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages