View rename_and_join_raw_files.bat
rename *.res *.csv | |
copy *.csv all_results_native_chinese.csv |
View addPercentagesLMTool
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 |
View DATEPARSE_from_DataSift
DATEPARSE("EEE, dd MMM yyy HH:mm:ss" ,[Interaction.Created At]) |
View copy_all.bat
for /R H:\... %%f in (*.csv) do copy %%f H:\... |
View append_at_the_beginning.bat
REM adds 'abc' at the beginning of each txt file | |
FOR %v IN (*.txt) DO REN %v abc%v |
View copy_all_no_subfolder_structure.bat
REM copy all pdfs from the source path (including subfolders) to the destination path (no subfolder structure) | |
xcopy <source path>\*.pdf <destination path> /s |
View heatmap_spectral.R
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)) |
View wide_to_long.R
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) |
View annotate_split.bat
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% |
View get_mean_pitch.R
# 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