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


"VR_RFT_City" contains the 82 Unity data files of the free exploration virtual city condition, 1 folder, 1 R-script,  and 1 Readme text file: 

# "VR_RFT_City_preprocessed" contains 81 csv-files of preprocessed data for each participant, 1 large summary file, and 1 Readme text file:
   Each participants file is named "City_Merge_participant number.csv", e.g. "City_Merge_2.csv" for participant 2.
   The preprocessed data are compiled into the large summary file "City_final.csv". 
   The Readme-textdocument "VR_RFT_Readme_City_preprocessed.txt" explains the preprocessed files further. 
 
# the Unity-data of the City condition are 82 csv-files:
   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"
   
   Special cases: "Montag, 21. November 2022_0.csv" is participant 1, but was mislabeled at creating the file. The data corresponds to "Montag, 21. November 2022_1.csv" in "VR_RFT_RFT" for the virtual RFT condition. "Freitag, 27. Januar 2023_16-38-43_80n.csv" is a second data set to participant number 80, who restarted the experiment after technical problems. See the experimental protocol for further information.

   The delimiter for the Unity data is "/", the decimal separator is ",". 

   The Unity data contains the following variables:
   # Timestamp - date and time (format yyyy/MM/dd HH:mm:ss:fffff)
   # Checkpoint_Reached - counter variable for virtual checkpoints collected in the free exploration task, values 0 - 11
   # Button_Void - counter variable for button presses keycode "0" on numbpad, (boolean state) the experimenter activates the VR environment for the participant, odd numbers = virtual city, even numbers = dark room (VR environment deactivated)
   # X_Controller_Input, Y_Controller_Input - input from the trackpad on the controller along the physical x- and y-axes
   # X_Head_Position, Y_Head_Position, Z_Head_Position - position of the HMD in global Unity-coordinates
   # X_Head_Tilt, Y_Head_Tilt, Z_Head_Tilt - rotation of the HMD in global Unity-coordinates

   The first 5 datasets contain additional variables, which were subsequently not assessed for the other participants:

   # X_Controller_Position, Y_Controller_Position, Z_Controller_Position - the position of the controller held by the participant in global Unity coordinates
   # X_Controller_Tilt, Y_Controller_Tilt, Z_Controller_Tilt - the rotation of the controller in global Unity coordinates

# "VR_RFT_Preprocessing_City.R" contains the steps for preprocessing the City Unity data of each participant and creating a large summary file of all participants

   When preprocessing the data with single digit participant numbers, change line 41-44 in the 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)