I have 10000 bivarate samples (x1, x2), and I want to estimate the marginal density of x2. I searched the R manual but couldn't find a function that can do this job. It seems "density" only works for single-variate samples. Can anybody help me with it? Thanks a lot! Best, J. Deng