diff --git a/vignettes/.gitignore b/vignettes/.gitignore index c911dc7..77d281f 100644 --- a/vignettes/.gitignore +++ b/vignettes/.gitignore @@ -1,3 +1,3 @@ *.html -*.R +#*.R faithful-demo diff --git a/vignettes/faithful-app.R b/vignettes/faithful-app.R new file mode 100644 index 0000000..fba9d4f --- /dev/null +++ b/vignettes/faithful-app.R @@ -0,0 +1,16 @@ +library(ts) + +get_hist <- ts_function( + function(bins = ts_integer(1)) { + h <- hist(faithful$waiting, breaks = bins, plot = FALSE) + data.frame(x = h$mids, y = h$density) + }, + result = ts_dataframe(eruptions = ts_numeric(), waiting = ts_numeric()) +) +get_smoother <- ts_function( + function(bandwidth = ts_numeric(1)) { + d <- density(faithful$waiting, bw = bandwidth) + data.frame(x = d$x, y = d$y) + }, + result = ts_dataframe(x = ts_numeric(), y = ts_numeric()) +)