Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home3/gardeoi3/public_html/iamrandom/includes/common.inc).

vector

Sum a vector (sumv)

This is the same as the R function sum when used on a vector.

double sumv(Rcpp::NumericVector A)
   {    int na= A.size();
         double b=0;
         for (int i = 0; i < na; i++)
         { b=b+A(i);
         }
         return b;
   }

Dot product (dot)

Multiply two vectors together using a dot product.

double dot(Rcpp::NumericVector c,Rcpp::NumericVector d)
   {     int nc= c.size();
         double e=0;
         for (int i = 0; i < nc; i++)
         {  e=e+c(i)*d(i); }
         return e;
   }