Skip to content

Commit

Permalink
remove formatR
Browse files Browse the repository at this point in the history
  • Loading branch information
jgeller112 committed Jan 20, 2025
1 parent 8074ee2 commit 0583798
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions _manuscript/L2_VWP_webcam_ET.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ language:
title-block-correspondence-note: "Correspondence concerning this article should be addressed to"
title-block-role-introduction: "Author roles were classified using the Contributor Role Taxonomy (CRediT; https://credit.niso.org/) as follows:"
format:
apaquarto-pdf: default
apaquarto-docx: default
execute:
echo: true
warning: false
Expand All @@ -137,7 +137,6 @@ execute:
#| echo: false
library(knitr)
library(formatR)
opts_chunk$set(fig.align='center', size="small", tidy.opts=list(width.cutoff=60), tidy=TRUE)
Expand Down Expand Up @@ -397,6 +396,8 @@ Once this is installed, `webgazeR` can be loaded along with additional useful pa

```{r}
#| label: packages
options(stringsAsFactors = FALSE) # no automatic data transformation
options("scipen" = 100, "digits" = 10) # suppress math annotation
Expand Down Expand Up @@ -473,35 +474,36 @@ First, we will create a cleaned up version of our use the behavioral, trial-leve
It is important to note here that what the behavioral spreadsheet denotes as trial is not in fact the trial number used in the eye-tracking files. Thus it is imperative you use `spreadhseet row` as trial number to merge the two files successfully.

```{r}
#|message: false
#|echo: true
eye_behav_L2 <- L2_data %>%
janitor::clean_names() %>%
# Select specific columns to keep in the dataset
dplyr::select(participant_private_id, correct, tlpic, trpic, blpic, brpic, condition, eng_targetword, targetword, typetl, typetr, typebl, typebr, zone_name, zone_type,reaction_time, spreadsheet_row, response) %>%
dplyr::select(participant_private_id, correct, tlpic, trpic, blpic, brpic, condition,
eng_targetword, targetword, typetl, typetr, typebl, typebr, zone_name,
zone_type, reaction_time, spreadsheet_row, response) %>%
# Filter the rows where 'Zone.Type' equals "response_button_image"
dplyr::filter(zone_type == "response_button_image") %>%
# Rename columns for easier use and readability
dplyr::rename(
"TL" = "tlpic", # Rename 'tlpic' to 'TL'
"TR" = "trpic", # Rename 'trpic' to 'TR'
"BL" = "blpic", # Rename 'blpic' to 'BL'
"BR" = "brpic", # Rename 'brpic' to 'BR'
"targ_loc" = "zone_name", # Rename 'Zone.Name' to 'targ_loc'
"subject" = "participant_private_id", # Rename 'Participant.Private.ID' to 'subject'
"trial" = "spreadsheet_row", # Rename 'spreadsheet_row' to 'trial'
"acc" = "correct", # Rename 'Correct' to 'acc' (accuracy)
"RT" = "reaction_time" # Rename 'Reaction.Time' to 'RT'
TL = tlpic, # Rename 'tlpic' to 'TL'
TR = trpic, # Rename 'trpic' to 'TR'
BL = blpic, # Rename 'blpic' to 'BL'
BR = brpic, # Rename 'brpic' to 'BR'
targ_loc = zone_name, # Rename 'zone_name' to 'targ_loc'
subject = participant_private_id, # Rename 'participant_private_id' to 'subject'
trial = spreadsheet_row, # Rename 'spreadsheet_row' to 'trial'
acc = correct, # Rename 'correct' to 'acc' (accuracy)
RT = reaction_time # Rename 'reaction_time' to 'RT'
) %>%
# Convert the 'RT' (Reaction Time) column to numeric type
mutate(RT = as.numeric(RT),
subject=as.factor(subject),
trial=as.factor(trial))
dplyr::mutate(RT = as.numeric(RT),
subject = as.factor(subject),
trial = as.factor(trial))
```

Expand Down

0 comments on commit 0583798

Please sign in to comment.