Manual: SynMap Toolbox For R Manual
User Manual:
Open the PDF directly: View PDF .
Page Count: 4
Download | |
Open PDF In Browser | View PDF |
Manual: SynMap Toolbox for R Árni Gunnar Ásgeirsson arnigunnar@unak.is 28 February 2018 Contents 1 Introduction 1 2 Install R 1 3 Analyze and visualize the grapheme-color create_syn_profile script 3.1 Set the working directory . . . . . . . . . . . . . 3.2 Run the create_syn_profile_webdata script . 3.3 Select the data file directory . . . . . . . . . . . . 3.4 Select all data files or a subset . . . . . . . . . . 3.5 Select the output . . . . . . . . . . . . . . . . . . 3.6 Consistency and color information output file . . 3.7 A PDF of consistency scores, and visualized color 1 mappings of synesthetes using the . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 2 2 2 3 3 4 Introduction This is a brief manual on how to use the the functions and scripts provided in the synMap toolbox for R analysis using R. This is a tiny package of scripts and functions for easy analysis of data from synMap. The functions are freely available for re-use and modification by anyone. The software comes with no warranty. The synMap online tool for mapping graphemes to colors in grapheme-color synesthesia is available here: https://synmap.azurewebsites.net Note that the instructions are based on data file naming conventions from our own lab. These are simple: we prefix our data files with log_ID_, e.g. log_ID_subject999.txt. If you follow this convention, the instructions should work without modification. If you prefer your own naming scheme, plese edit the create_syn_profile_webdata.R script, so that the inclusion pattern matches the scheme. Below is the line of code you must change, if you use a different naming scheme. This line of code is found near the top of the ‘create_syn_profile_webdata.R’ script: allfiles = dir(pattern = 'log_ID_') # <---- change 'log_ID_' to a pattern you prefer Example code, modified to match files with the prefix my_syn_data_, rather than log_ID_. allfiles = dir(pattern = 'my_syn_data_') #collect only 'my_syn_data_' files into a vector 2 Install R Skip this step if you have a working version of R on your computer. If you have not yet installed R on your computer, you can download it from here: https://cran.r-project.org. Follow the installation instructions that match your operating system. From here, it is wise to intall Rstudio to get a nicer user interface https://rstudio.com. If the interface becomes relevant in this manual, the author will assume that the user is using Rstudio. 1 3 Analyze and visualize the grapheme-color mappings of synesthetes using the create_syn_profile script The create_syn_profile script uses all the functions in syn_functions to return: 1) a visualization of grapheme-color associations and their strength and 2) a file with the consistency measures for all graphemes and detailed color information. The visualization gives a quick overview of a synesthete’s grapheme-color associations, helps identify incorrect (accidental) color-mappings. The visualization is also very useful for comparing the quality of synesthesia over time. 3.1 Set the working directory To get started you must first set the working directory to the folder that contains the create_syn_profile.R script, and the syn_functions.R file. To do this, you type: setwd(‘[your target directory]’) into the Console window, where [target directory] is the path to the directory containing your script. You can make sure that you have reached the correct destination by typing dir() in the Console. This gives you a list of all files and folders in the working directory. Example: dir() ## [1] "~$nual_draft.docx" ## [3] "colconst_example.png" ## [5] "dir_prompt.PNG" ## [7] "manual.pdf" ## [9] "manual_draft.docx" ## [11] "profile_example.PNG" ## [13] "tex2pdf.16024" ## [15] "tex2pdf.518668" 3.2 "colconst_example.MHT" "create_syn_profile_webdata.R" "git_check.R" "manual.Rmd" "pilot_mini_toobox_edit.Rproj" "syn_functions_webdata.R" "tex2pdf.469688" "tex2pdf.590388" Run the create_syn_profile_webdata script To do a standard analysis of grapheme-color mappings, you run the command: source('create_syn_profile_webdata') in the R Console. 3.3 Select the data file directory The script can analyze data from multiple data files in a single run. Therefore, you start by selecting the directory where you keep all your data files. You will get a chance to select a subset of these files in a later step. A window appears, where you can browse you way to the desired directory. 3.4 Select all data files or a subset When you have chosen an appropriate folder, a list of data files will be printed in the console window. You are now prompted (in the Console) to confirm that you want to analyze all data files, or a subset. You type n and press return, to analyze all files, but y if you want to select a subset of these files. If opt for a subset, you will be prompted to type the index numbers of the desired files. Please separate these numbers by space. Finally, you will see a list of selected files in the console, and will be asked confirm that the files. 2 Figure 1: Example of a Consistency and Color output file in Notepad++ 3.5 Select the output In this step, you select the desired output of the analysis. 3.6 Consistency and color information output file First, you will be asked whether you want a .txt file wih consistency scores (Eagleman et al, 2007, Equations 1 and 2), as well as color information. The output file will have 18 columns. Consistency and color information files will be printed in a new folder, within you data folder. The new folder will be named color-consistency-files. 3.6.1 Column 1: Grapheme This column displays the graphemes analyzed in your data set. 3.6.2 Column 2: diffScore This column displays the consistency scores. 3.6.3 Column 3-5: hex1-3 These columns display the hex color codes for trials 1, 2 and 3, for each grapheme. 3.6.4 Column 6: hexAvg This column displays the averaged hex color code for all 3 trials. 3.6.5 Columns 7-15: R G B These columns display the R, G and B values for trials 1, 2 and 3, for each grapheme. 3.6.6 Columns: 16-19: R_avg G_avg B_avg These columns display the average R, G and B values for all 3 trials. 3 Figure 2: Example of a synesthesia profile visualization 3.7 A PDF of consistency scores, and visualized color information. Second, you will asked whether you want your plots to be printed as .pdf files. If you select n, the visualized synesthesia profile of participants will only be displayed in the plot window of R. If you select y, PDFs will be rendered in your data folder. 4
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 4 Page Mode : UseOutlines Author : Árni Gunnar Ásgeirsson arnigunnar@unak.is Title : Manual: SynMap Toolbox for R Subject : Creator : LaTeX with hyperref package Producer : pdfTeX-1.40.18 Create Date : 2018:06:05 13:34:12Z Modify Date : 2018:06:05 13:34:12Z Trapped : False PTEX Fullbanner : This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX) kpathsea version 6.2.3EXIF Metadata provided by EXIF.tools