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
rename *.res *.csv | |
copy *.csv all_results_native_chinese.csv |
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
Sub addPercentagesLMTool() | |
ActiveCell.FormulaR1C1 = "percPreApproved" | |
Range("I1").Select | |
ActiveCell.FormulaR1C1 = "percApproved" | |
Range("J1").Select | |
ActiveCell.FormulaR1C1 = "percPreRejected" | |
Range("K1").Select | |
ActiveCell.FormulaR1C1 = "percRejected" | |
Range("L1").Select |
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
DATEPARSE("EEE, dd MMM yyy HH:mm:ss" ,[Interaction.Created At]) |
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
for /R H:\... %%f in (*.csv) do copy %%f H:\... |
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
REM adds 'abc' at the beginning of each txt file | |
FOR %v IN (*.txt) DO REN %v abc%v |
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
REM copy all pdfs from the source path (including subfolders) to the destination path (no subfolder structure) | |
xcopy <source path>\*.pdf <destination path> /s |
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
library(tidyr) | |
foreign_victims_wide <- read.csv("foreign_victims_wide.csv") | |
# reshape to long format | |
foreign_victims_long <- gather(foreign_victims_wide, Year, Victims, X1998:X2012) | |
# remove Xs | |
# could be omitted if using check.names=FALSE in read.csv() | |
foreign_victims_long$Year <- gsub("X", "", paste(foreign_victims_long$Year)) | |
write.csv(foreign_victims_long, file = "foreign_victims_long.csv", row.names=FALSE) |
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
library(ggplot2) | |
library(RColorBrewer) | |
# make the heatmap | |
# based on https://gist.github.com/dsparks/3710171 | |
myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral")), space="Lab") | |
zp1 <- ggplot(foreign_victims_long, | |
aes(x = Year, y = Country, fill = Victims)) | |
zp1 <- zp1 + geom_tile() | |
zp1 <- zp1 + scale_fill_gradientn(colours = myPalette(100)) |
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
REM define the working directory | |
set location=%cd% | |
REM define the participant | |
set participant=NAME | |
REM define the trial | |
set trial=01 | |
REM define the condition | |
set condition=FAF-Up | |
REM define the file name, e.g. 01-NAME-FAF-Up.wav | |
set filename=%trial%-%participant%-%condition% |
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
# Get mean pitch and duration | |
# Frequency altered feedback study | |
# PraatR documentation: http://www.aaronalbin.com/praatr/tutorial.html | |
# loop through all the files in a directory | |
library("PraatR") | |
library("phonTools") | |
# define the partcipant/folder/output file name | |
participant <- "NAME" |
OlderNewer