Reading in data. This takes the actual labels from the Labelled Data CSV option from Redcap, but assigns the abbreviated variable names from the Raw Data set. (the column names in the labelled dataset are horrifically long.)

  1. Navigate to the “Project Home” tab in RedCap, then to “Export Data”.
  2. Download “CSV/Microsoft Excel (raw data)”, then “CSV/Microsoft Excel (labels)”.
  3. In the “Files” tab in the bottom right window of RStudio, click “Home”. This should take you to a list of the folders on your computer. Go to Downloads and locate the two CSV files that you just downloaded from R.
  4. One at the time, check the box to the left of each file, then click “Rename”. Rename the labeled dataset “pets_labels.csv”, and the unlabeled or “raw” dataset “pets_raw.csv”.
  5. Go to “Session” (a tab on the top of the page) and select “Set Working Directory” -> To Files Pane Location.

Now, copy and past the code below into the Console (bottom left window):

d <- read.csv(“pets_labels.csv”)

e <- read.csv(“pets_raw.csv”)

names(d) <- names(e)

This should make d = the labelled dataset, and e = the raw data, which has abbreviated column names. Each dataset should have been uploaded, and is stored in the “files” section of RStudio (you should be able to see them if you navigate to the “Files” tab in the bottom right window).