You are missing var
variable in your data frame. That's why it is being looked up in a global environment, where it stands for variance function. This is just a copy-paste error; the following code works.
ggplot(trial, aes(x=Dates, y=day_propor, group=Day_Night, fill=Day_Night)) +
geom_area(position="fill")
As a final note, you may have trouble with your Dates
as a factor. Conversion an appropriate datetime object like POSIXct
may be helpful.