add file
This commit is contained in:
parent
60e90cf4c8
commit
6ea0b67993
2
vignettes/.gitignore
vendored
2
vignettes/.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
*.html
|
*.html
|
||||||
*.R
|
#*.R
|
||||||
faithful-demo
|
faithful-demo
|
||||||
|
|||||||
16
vignettes/faithful-app.R
Normal file
16
vignettes/faithful-app.R
Normal file
@ -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())
|
||||||
|
)
|
||||||
Loading…
x
Reference in New Issue
Block a user