View source: R/basic_functions.R
change_grid | R Documentation |
Compute a function (evaluated on a grid) on a given (finer) grid.
change_grid(fct, grid, new_grid)
fct |
a numerical vector, the function to evaluate on the new grid. |
grid |
a numerical vector, the initial grid. |
new_grid |
a numerical vector, the new grid. |
a numerical vector, the approximation of the function on the new grid.
grid <- seq(0,1,l=1e1)
new_grid <- seq(0,1,l=1e2)
fct <- 3*grid^2 + sin(grid*2*pi)
plot(grid,fct,type="o",lwd=2,cex=1.5)
lines(new_grid,change_grid(fct,grid,new_grid),type="o",col="red",cex=0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.