wrapper to generate random samples from a density function given by a character string as an argument