I am trying to extract a measure of information use (mean cues used) from an rpart object. Specifically, I want to calculate, for each case, how many nodes (i.e.; pieces of information ) were used to classify that case.
This code corresponds to the examples in Phillips et al. (2017)
This guide takes you through the steps of creating an R package for the purpose of storing and documenting scientific data, analysis, and writing
Counting the number of unique values in a column that do not appear in previous columns.
Here is an example of how to stochastically create a vector of outcomes from a Markov chain in R
SPDS lab presentation 24 Feb 2015
Preliminary analyses of competitive sampling study conducted in May 2014 at the MPI exploring two key effects: having practice games and whether having the option to reject unchosen options increases sample sizes.
Simplified NSM simulations exploring the relationship between confidence and best estimate accuracy.
Lecture 4 Goals: 1. Learn about the matrix and dataframe data objects 2. Know how to use brackets [,] to index matricies and dataframes 3. Use the $ sign and logical vectors to index dataframes
Lecture 5 Goals 1. Learn to use read.table() to load data from a file 2. Learn to use write.table() to write data to a file 3. Use setwd() to set the working directory of your current R session
The function Freq.Grid creates a frequency grid plot. I am still working out a few bugs in the code so it's not quite ready for release.
Lecture 3 Goals: 1. Download the priceless R reference card 2. Learn functions for generating data from probability distributions: rnorm(), runif() 3. Learn functions for basic descriptive statistics: mean(), median(), sd(), var(), min(), max()
This lecture shows you how to make custom functions in R. As examples, we create a custom mean function that can automatically remove outliers, a histogram function that adds reference lines for the median and mean, and a scatterplot function that adds a regression line and a sentence summarising the conclusions.
Lecture Goals: 1. Learn how to create "for loops" to run an action over an index variable 2. Understand how to create "design matricies" using expand.grid to make loops simpler 3. Create multiple plots in a grid easily using a loop
Here's a quick example on how dplyr reduces code