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
hwanalysis <- function(hwnumber = NULL, base_graphing=FALSE) { | |
# A standalone R function, so to use it, use source("hwanalysis.R") from the command line and then call hwanalysis() with | |
# 1). the numeric number of the HW you want to analyze grades for and | |
# 2). the graphing style you want. The default base_graphing= FALSE uses ggplot (requires ggplot2 and dplyr be | |
# installed). base_graphing=TRUE gives you old school base R plots, thus no additional dependencies. (but we should all | |
# have ggplot2 and dplyr anyway right?) | |
if (is.null(hwnumber)) { | |
stop('hwnumber must be an integer which defines which hw you want to analyze grades for!') |
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
function resps = getSubjectInfo(varargin) | |
<<<<<<< HEAD | |
% Calling | |
% c=struct('radio',struct('eeg',struct('label','EEG Experiment?')), ... | |
% 'textinput',struct('subNum',struct('label','Subject Number')),... | |
% 'dropdown',struct('session',struct('label','Session','val',[1 2]))); | |
======= | |
% Calling Example | |
% c = { struct('name','sub_num','type','textinput','label','Subject Number','classcheck',@(x) (isnumeric(x) && ~isnan(x))), ... |
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
function factor_cell_mat = factor_magic(nrow, factors) | |
% Calling example: | |
% factors = {[1,2],[.25,.75] ; | |
% [1,2],[.5,.5] ; | |
% [1,2,3],[1/3,1/3,1/3] } | |
% factor_magic(2,48,factors) | |
factor_cell_mat = cell(nrow,size(factors,1)); | |
for i=1:size(factors,1) | |
nFactors = length(unique(factors{i,1})); |
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
matlab -r "cd('C:\Users\will\Documents\CEMNL\Testing Differentially Strengthens Recovery\Runfiles\');path(path,pwd);main" |
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
function onset = draw(cue,msg,string,drawExtra) | |
drawExtra(params{:}) | |
DrawFormattedText(windowPtr,cue,'right', 'center',[],[],[],[],[],[],left-[0 0 spacing 0]); | |
DrawFormattedText(windowPtr,msg, 'center','center'); | |
DrawFormattedText(windowPtr,string,right(1)+spacing, 'center'); | |
[~, onset] = Screen('Flip', windowPtr); | |
end |
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
ratingsROC <- function(Fcount =c(2,8,37,23,30), Hcount = c(61,15,15,5,4)) { | |
#R script to fit ROC data from confidence rating task | |
#CMR + WJH Mar 26 2015 | |
#data from Macmillan & Creelman 2005 Example 3b | |
#Low Frequency words, confidence rating recognition task | |
# Counts are ordered from 'sure old' to 'sure new' response for each stim class | |
fa_probs <- cumsum(Fcount)/sum(Fcount) | |
h_probs <- cumsum(Hcount)/sum(Hcount) |
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(dplyr) | |
library(reshape2) | |
library(ggplot2) | |
n <- 500 | |
null <- .75 | |
obs_n <- seq(1,n-1) | |
binom_probs_low <- pbinom(obs_n, n, null) | |
binom_probs_upp <- pbinom(obs_n, n, null,lower.tail = FALSE) | |
binom_probs <- pmin(binom_probs_low, binom_probs_upp) |
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
cat /var/log/dpkg.log |awk '/ removed / {printf "%s\n",$0}' |
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
## Some sort of list comprehension using only functional programming | |
## techniques that returns a list holding the coefficients of variation | |
## (i.e. the mean divided by the standard deviation) for each column in the | |
## mtcars data set. | |
## This isn't the clearest code (i.e. its really hard to tell its dividing | |
## the mean by the standard deviation) but it uses absolutely no imperative control | |
## flow structures and no vectorized R functions, so if you can read and understand | |
## this you can do you some functional programming for great good =). I can't believe I | |
## actually figured this out, much less that I figured it out in like 5 minutes, |
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
%--------------------------------------------------------% | |
% Onscreen script to record race/ethnic/sex demographics % | |
% for Matlab % | |
% Updated 09/21/2015 % | |
%--------------------------------------------------------% | |
%{ | |
Purpose: | |
A Matlab script which will generate a set of dialog boxes that ask | |
participants an assortment of questions regarding demographics (in |
OlderNewer