I have a CMS that I intend to use for a number of websites on Azure. 

I want to be able to create clones of the website easily and have them deployed to Azure. 

Azure Automation was suggested as one possible solution, does this service fit my need?

Which Azure service should I use to do this?
['https://Stackoverflow.com/questions/31412283', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4429847/']
No need for sapply, as far as I can see. Try something like this.

```
adj1 <- 1 + rbind(0, Adjusted)
adjprod <- apply(adj1, 2, cumprod)

result <- Orig * adjprod
result[result > 100] <- 100
result

```
Here's an [Rcpp](http://cran.r-project.org/web/packages/Rcpp/index.html) implementation:

```
library('Rcpp');
cppFunction('
    NumericMatrix makeOriginal(double orig, int NR, int NC ) {
        NumericMatrix m(NR,NC);
        for (size_t c = 0; c < NC; ++c)
            m[c*NR] = orig;
        for (size_t r = 1; r < NR; ++r) for (size_t c = 0; c < NC; ++c) {
            size_t i = r+c*NR;
            m[i] = std::min<double>(m[i-1]*(i+1),100);
        }
        return m;
    }
');
makeOriginal(0.45,13L,10L);
##         [,1]   [,2]   [,3]   [,4]   [,5]   [,6]   [,7]   [,8]   [,9]  [,10]
##  [1,]   0.45   0.45   0.45   0.45   0.45   0.45   0.45   0.45   0.45   0.45
##  [2,]   0.90   6.75  12.60  18.45  24.30  30.15  36.00  41.85  47.70  53.55
##  [3,]   2.70 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [4,]  10.80 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [5,]  54.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [6,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [7,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [8,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
##  [9,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
## [10,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
## [11,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
## [12,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00
## [13,] 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00 100.00

```

**Edit:** Another approach, but similar:

```
cppFunction('
    NumericMatrix makeOriginal(double orig, int NR, int NC ) {
        NumericMatrix m(NR,NC);
        size_t len = NR*NC;
        for (size_t i = 0; i < len; ++i)
            m[i] = i%NR == 0 ? orig : std::min<double>(m[i-1]*(1+i),100);
        return m;
    }
');

```