Suppose that I have a variable like X with unknown distribution. In Mathematica, by using SmoothKernelDensity function we can have an estimated density function.This estimated density function can be used alongside with PDF function to calculate probability density function of a value like X in the form of PDF[density,X] assuming that "density" is the result of SmoothKernelDensity. It would be good if there is such feature in R.This is how it works in Mathematica
http://reference.wolfram.com/mathematica/ref/SmoothKernelDistribution.html
As an example (based on Mathematica functions):
data = RandomVariate[NormalDistribution[], 100]; #generates 100 values from N(0,1)
density= SmoothKernelDistribution[data]; #estimated density
PDF[density, 2.345] returns 0.0588784
Here you can find more information about PDF:
http://reference.wolfram.com/mathematica/ref/PDF.html
I know that I can plot its density function using density(X) in R and by using ecdf(X) I can obtain its empirical cumulative distribution function.Is it possible to do the same thing in R based on what I described about Mathematica?
Any help and idea is appreciated.

density(x)gives an estimate of the pdf, as you already noted, but its suitability depends on the purpose for which you want to have the density. Note, for example, that the variance is biased up (in performing convolution, you add the variance of the kernel to the variance of the data, itself an unbiased estimate) - such bias-variance tradeoffs are ubiquitous. There are other alternatives, such as log-spline density estimation, for example -- but again, its suitability partly depends on what you want to do with it. – Glen_b Dec 05 '13 at 23:08ecdf(X)gives me the equivalent percentile of 7.5 but it's not what I'm looking for. – Amin Dec 05 '13 at 23:59ecdf(7.5)-ecdf(7)?If X is supposed to have a discrete distribution, how can I find P(X=7.5) when I only have a set of observed values? – Amin Dec 06 '13 at 06:59ecdf(b)-ecdf(a)would estimate $P(\text{a}<X\leq \text{b})$. Of course with continuous variables the distinction between $<$ and $\leq$ is unimportant. If $X$ is discrete, then you can estimate $P(X=7.5)$ by computing the sample proportion of values that are 0.75. – Glen_b Dec 06 '13 at 07:03PDFin Mathematica gives the value of density function for given X value?and it's not probability? That was my impression from their definition. – Amin Dec 06 '13 at 17:58PDFis unambiguous. For continuous cases (as with what's returned bySmoothKernelDistribution)PDFreturns a density, and they go to some lengths right on that page to make the distinction between density and probability clear. – Glen_b Dec 06 '13 at 23:56