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(lme4) | |
library(dplyr) | |
library(broom) | |
p_vals <- lapply(1:1000, function (x) { | |
df <- expand.grid( | |
subject = 1:30, | |
trial = 1:8, | |
condition = c('Control','Experimental') | |
) |
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
<?php | |
$map = directory_map('/path/to/folder/'); | |
$file_paths = concatenate_filepaths($map); | |
function concatenate_filepaths ($map, $prefix = '') { | |
$return = array(); | |
foreach ($map as $key => $file) { | |
if (is_array($file)) { |
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
# create demo dataframe | |
data <- data.frame( | |
obs = 1:20, | |
value = rbinom(20, 2, .5) | |
) | |
# calculate runs of duplicate values | |
runs <- rle(data$value) | |
# create cluster vector use runs |
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
# load *eyetrackingR* and set data options | |
library(eyetrackingR) | |
data_options = set_data_options(item_columns = "Trial", trial_column = "Trial", time_column = "TimeFromPhaseOnset", trackloss_column = "TrackLoss", aoi_columns = c('Animate','Inanimate'), participant_column = "ParticipantName") | |
# verify colums in dataset | |
master_clean <- verify_dataset(master_clean, data_options) | |
# analyze and remove trackloss-ridden trials | |
master_clean <- convert_non_aoi_to_trackloss(master_clean, data_options) |
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(beepr) | |
# ...run something that takes a long time... | |
beep(8); |
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
<?php | |
// webpage_filesize() | |
// | |
// returns the total number of Bytes downloaded | |
// when a single webpage is accessed without any caching | |
// | |
// requires: cURL | |
// | |
// @param string $url (e.g., 'http://www.cbc.ca') |