Quantcast
Channel: creating recursive function in r - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Rui Barradas for creating recursive function in r

The following function computes the formula in the question but it gives yet another result.theval <- function(data, n) { z <- numeric(nrow(data)) for (i in n:length(data$x)) { z[i] <-...

View Article



creating recursive function in r

set.seed(1)x <- runif(50, 0, 1)y <- runif(50, 0, 1)df<-as.data.frame(cbind(x,y))vall<-c(rep(0,50))n<-4theval <- function(data) { for (i in n:length(data$x)) { vall[i] <-...

View Article
Browsing all 2 articles
Browse latest View live


Latest Images