Tarleton Yearbook Photo Renaming Workflow

Body

Table of Contents

Requirements for Workflow

Files

  • Excel spreadsheet which has a full list of all students for the yearbook. This should include UID, last name, and first name in separate columns.
  • Folder with all available student pictures, typically provided by the Texan Card office. The photo files are named after the student's UID.
  • Yearbook Renaming.Rmd file, attached to this article.

Computer & Software

  • Windows PC (RStudio cannot be run on a Mac).
  • RStudio & Windows R installed (details below).
  • Any Tarleton staff member or student worker can run the process on the PC.

Provided there are no issues, the entire process from prep to completion will take an hour or less.

Installing RStudio

These steps can be skipped if the PC already has RStudio available.

Install Software

Open Company Portal.

Search for "rstudio".

Uploaded Image (Thumbnail)

Click on RStudio, and then click on the Install button.

Uploaded Image (Thumbnail)

Once RStudio installation is complete, search Company Portal for "r for windows".

Click on R for Windows, and then click on the Install button.

Uploaded Image (Thumbnail)

When that installation is complete, you can close Company Portal.

Configure Software

Open RStudio.

In the Choose R Installation window, select "Choose a specific version of R".

Click on the version of R listed below that option, and then click OK.

Uploaded Image (Thumbnail)

RStudio should open normally.

Preparing Yearbook Files

The Yearbook Renaming.Rmd code requires specific file names and file paths. In order to minimize the amount of changes you'll need to make to the code itself, follow these instructions to enable the code to find and work with your files successfully.

Excel Spreadsheet

In the spreadsheet, make sure it has these three columns, named exact as this:

  • Last Name
  • First Name
  • UID

All other columns should be removed.

Save the file and rename it "Original Report".

Uploaded Image (Thumbnail)Example of the Original Report.xlsx file.

Photos

All photos should be named after the student's UID, with a .jpg at the end.

All photos should be in the same folder. Rename the folder "Original Photos".

Remove any non-photo files inside the folder.

Organize the Files On the PC

Log into the Windows PC being used as the user who will run the code.

On the desktop, create the folder "Yearbook".

In the Yearbook folder, create another folder called "New Photos". Leave it empty.

Copy Original Report and Original Photos into the Yearbook folder.

Copy Yearbook Renaming.Rmd into the Yearbook folder.

The Yearbook folder on your desktop should now look like this:

Uploaded Image (Thumbnail)

Editing Yearbook Renaming.Rmd

Upon the first launch of Yearbook Renaming.Rmd on the PC, you will need to install support packages within RStudio and update the file paths to match your current user account. These steps are not required if the same user is using the same PC that has previously run the code.

Install Packages

Double-click on Yearbook Renaming.Rmd, located in the Yearbook folder on the desktop.

  • If prompted to select an app to open the file, select RStudio.

If packages need to be installed, then you'll see a yellow notice banner about the missing packages.

Click Install in the notice to automatically install them.

Uploaded Image (Thumbnail)Notice banner and install link for needed RStudio packages.

Alternatively, you can also install the packages manually, but this shouldn't be required.

  • Click on the Packages tab near the center right of the RStudio window.
  • Click Install.
  • In the Install Packages window, search for the package you want to install (see the list in the code on the left side, starting on Line 11).
  • You can add multiple packages to the line, putting a space or comma between each one. Or install them one at a time.
  • When ready, click Install.

Uploaded Image (Thumbnail)Manual RStudio package install process.

Uploaded Image (Thumbnail)Type in package names listed in the code to add to the install queue.

Update File Paths

With Yearbook Renaming.Rmd still open in RStudio, you'll need to replace "USERNAME" with the username of the currently logged-in user. Note, the entered username must be in all caps. This change is required on four lines:

  • Line 23, reference_path
  • Line 26, source_folder
  • Line 29, destination_folder
  • Line 32, log_csv_path

Uploaded Image (Thumbnail)

Running Yearbook Renaming.Rmd

With RStudio installed, source files in place, and Yearbook Renaming.Rmd configured, you are now ready to run the code to create a new Excel spreadsheet and rename the photo files.

Open Yearbook Renaming.Rmd in RStudio.

In the center of the toolbar directly above the code window, click Knit.

  • Process details will be in the Render tab below as the code runs.
  • Expect it to take 5 to 15 minutes, depending on the age and condition of the PC.

Uploaded Image (Thumbnail)Knit button in RStudio.

When the process is finished, a title window will pop up. You may close it.

Uploaded Image (Thumbnail)Completion window.

Go to the Yearbook folder on the desktop and check the new Excel file named New Report and the renamed photos in New Photos.

Uploaded Image (Thumbnail)

New Report should have columns for UID, the new photo name, last name, and first name.

The photos in New Photos are new copies of the photos from Original Photos, and are now named in numeric sequential order.

Combining Student Lists

The New Report sheet will only contain a list of students with photos. You can go through these steps to add all students without a photo, giving you a final list of all students in a single spreadsheet.

Make a copy of New Report and name it New Report Sort.

Open New Report Sort and the Original Report file in Excel.

In Original Report, copy the names and UIDs of all students. Paste them into the matching columns at the bottom of New Report.

In New Report, highlight duplicate UIDs:

  • Select the entire UID column.
  • Go to Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values
  • Select the default red coloring, and then click OK.

Uploaded Image (Thumbnail)

All UID entries with duplicates (those with photos) will be in red. The UID entries not in red are the students without a photo.

Sort the sheet by cell color:

  • Select all columns with data.
  • Go to Data > Sort
  • Column = UID
  • Sort On = Cell Color
  • Order = No Cell Color, On Top

Uploaded Image (Thumbnail)

Uploaded Image (Thumbnail)

The rows with uncolored UIDs (students without photos) will be at the top of the sheet.

Copy the uncolored rows (all four columns), including the column names (Row 1).

Open the unaltered New Report file.

Rename the first sheet as Photo.

Create a second sheet and rename it No Photo.

Paste the uncolored rows into the No Photo sheet.

Uploaded Image (Thumbnail)Example of New Report with both sheets.

New Report now lists every student. The total number of rows in the Photo and No Photo sheets should equal the total number of rows in Original Report minus one.

Make a copy of New Report and name it New Report Vendor (or whatever name you want for the vendor).

In the new copy, delete the UID columns in both sheets. This copy and the renamed photos in New Photos are now ready to be sent to the vendor.

It is recommended that all files be gathered and put into a new folder named after the yearbook year. Then archive that folder along with your other yearbook files. Clear out old files from the Yearbook folder, making it ready for next year's files.

Further Support

Members of the Department of Student Media or other staff members/student workers should send their initial request for support through normal ITS channels.

  • Call the Service Desk at 254-968-9885
  • Email the Service Desk at helpdesk@tarleton.edu
  • Contact your assigned zone tech

All further support request escalations should be done by ITS staff only.

  • Paul Quinnell - ITS lead on this project and this article's author.
  • Paul Salie - Non-ITS staff member who created the R markdown file.

Details

Details

Article ID: 17827
Created
Mon 4/28/25 12:44 PM
Modified
Wed 4/30/25 10:09 AM

Attachments

Rmd

Yearbook Renaming.Rmd Computer

Mon 4/28/25 2:09 PM
;