Skip to content

Instantly share code, notes, and snippets.

View Dasonk's full-sized avatar

Dason Kurkiewicz Dasonk

View GitHub Profile
@Dasonk
Dasonk / normalProbabilities.R
Created February 20, 2014 16:46
How to calculate normal distribution probabilities in various languages
# dnorm gives the pdf for the normal at x
dnorm(1)
# pnorm gives the cdf for the normal at x
# P(Z < 1)
pnorm(1)
# They also accept parameters to specify the mean and standard deviation
# X ~ N(mean = 2, sd = 4)
# P(X < 1)
pnorm(1, 2, 4)
@Dasonk
Dasonk / monitor_object.R
Last active December 11, 2017 21:38
Function to create a function to use as a taskCallBack to monitor changes in objects easily
#' Monitor objects using output
#'
#' This creates a function that is meant to be used as a taskCallBack.
#' You can call the resulting function directly yourself when you want
#' to monitor changes but that isn't the intended use.
#'
#' @param object_name Character string. The object name you want to montior
#' @param FUN function - The function used to monitor the object for changes.
#' The only time notifications will be messaged is when
#' the output from FUN changes.