I need to plot in R a function of the log likelihood. I have a fixed n, multiple values for k and arbitrary pi between 0 and 1. I tried this code but the result is not what i want:
n<-10
k<-c(8,8,5,4,6)
pi = seq(0,1,length=100)
l = function(pi){k*log(pi) + (n-k) * log(1-pi)}
plot(x=pi,y=l(pi),ylab="l(pi)",xlab="q",type="l",ylim=c(-10,0))
the plot is far from a normal curve
please help

