# Experiment 4: 2022/23 Replication of Field-Dependency and Cybersickness
# Study run by J. Josupeit, L. Greim, and S. Sanchez Rivas


"VR_RFT_RFT" contains the Unity-data for the virtual RFT condition, 1 folder, 1 R-script and 2 Readme text files: 

# the folder "VR_RFT_RFT_preprocessed" contains 81 csv-files of preprocessed data for each participant, 1 large summary file, and 1 Readme text file:
   81 files for each participant follow the naming format "RFT_Merge_participant number.csv", e.g. "RFT_Merge_2.csv" for participant 2. 
   All preprocessed data are merged into 1 large summary file "RFT_final.csv". 
   "VR_RFT_Readme_RFT_preprocessed.txt" explains the preprocessed files further.

# the Unity-data is ideally one csv-file per participant, 81 files in total: 
   The files are named in long data format: "weekday, day. month year_hh-mm-ss_participant number.csv" (in German)
   The first 7 participants were labeled without hh-mm-ss as "weekday, day. month year_participant number.csv"
   If there are multiple files per participant, use the experimental protocol to find out how to proceed.

   The delimiter for the Unity data is "/", the decimal separator is ",". 
   The datasets contain the following variables:

      # Timestamp - date and time (format yyyy/MM/dd HH:mm:ss:fffff)
      # Trialnumber - counter for activated trials, can be higher when the trial was revised
      # Trigger - counter for pulls on the trigger on the back of the controller 
      # Z_Frame - rotation angle of the frame in global Unity-coordinates z-direction
      # Z_Rod - rotation angle of the rod in global Unity-coordinates z-direction
      # X_Controller_Input, Y_Controller_Input - input from the trackpad along the physical x- and y-axes  
      # X_Head, Y_Head, Z_Head - position of the HMD the participant is wearing in global Unity-coordinates
      # X_Head_Tilt, Y_Head_Tilt, Z_Head_Tilt - rotation of the HMD the participant is wearing in global Unity-coordinates

      the first 5 participants contain additional variables that were subsequently not assessed for all:

      # X_Frame, Y_Frame - rotation angle of the frame in global Unity-coordinates in x- and y-direction
      # X_Rod, Y_Rod - rotation angle of the rod in global Unity-coordinates in x- and y-direction
      # X_Controller_Position, Y_Controller_Position, Z_Controller_Position - position of the controller held by the participant in global Unity-coordinates
      # X_Controller_Tilt, Y_Controller_Tilt, Z_Controller_Tilt - rotation of the controller in global Unity-coordinates

      Note that the variable "Trigger" was not assessed for the first 5 participants.

# "VR_RFT_Preprocessing_RFT.R" contains the steps for preprocessing the RFT Unity-data for each participant and creating a large summary file.
   
   When preprocessing the data with single digit participant numbers, change line 50-53 in the R-script with the following code:
      # Subtract participants code from file name
      Z <- str_sub(Z, -5, -1)
      Z <- str_sub(Z, 1, 1)
      Z <- as.numeric(Z)

# "VR_RFT_Readme_Preprocessing_special_cases.txt" contains adapted code for 4 special cases regarding the participants 72, 10, 54, and 1 to 5, to change in "VR_RFT_Preprocessing_RFT.R". The text file advises which lines must be adapted for each special case.   
