added sample() function (mimicking R's sample function) for 1-D Arrays