Your Prices variable contains no prices, but pointers. The R language has no pointers. Do really send an array of prices to R and also check if you need a row-major or column-major matrix.