Skip to content

Instantly share code, notes, and snippets.

View R-function-ex1.R
> f <- function(x, y, z) { print(c(x, y, z)) }
> f(2, 3, 9)
[1] 2 3 9
View ghyp-slider.R
.slider.env = new.env()
.sliderMenu <- function(refresh.code, names, minima, maxima, resolutions,
starts, title = "Slider", no = 0, set.no.value = 0) {
# Requirement:
if (!require(tcltk, quietly = TRUE))
stop("\n -- Package tcltk not available -- \n\n")
# Environment:
if (!exists(".slider.env"))
View ghyp-examples.R
> library(GeneralizedHyperbolic)
> dghyp(2)
[1] 0.08878272
> dghyp(0)
[1] 0.3055948
> dghyp(3, mu = 4)
[1] 0.2019553
> dghyp(3, mu = 4, alpha = 3)
[1] 0.1789202
> ghypdata <- rghyp(1000)