I want to generate a chi squared distribution with 100,000 random numbers with degrees of freedom 3.
This is what I have tried.
df3=data.frame(X=dchisq(1:100000, df=3))
But output is not I have expected. I used below code to visualize it.
ggplot(df3,aes(x=X,y=..density..)) + geom_density(fill='blue')
Then the pdf looks abnormal. Please help