Last active
March 29, 2018 17:02
-
-
Save mark-andrews/c4bfe8aa4d155d23292544c95695e732 to your computer and use it in GitHub Desktop.
Record accuracy in tricky data set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
correct_response_map_1 <- or$correct[1:8] | |
correct_response_map_2 <- or$correct.1[1:8] | |
names(correct_response_map_1) <- or$key_config_1[1:8] | |
names(correct_response_map_2) <- or$key_config_2[1:8] | |
new_or %>% mutate(correct_response_num_if_1 = correct_response_map_1[stim_type], | |
correct_response_num_if_2 = correct_response_map_2[stim_type], | |
correct_reponse_num = (Key_config == 1)*correct_response_num_if_1 + (Key_config == 2)*correct_response_num_if_2, | |
accuracy = correct_reponse_num == response_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 8 is a bit funny looking. Ultimately, it selects the value in
correct_response_num_if_1
wheneverKey_config
is1
and selectscorrect_response_num_if_2
wheneverKey_config
is2
.