There is a function called df. If you start with a fresh R session and try to execute
df$Female
you will get the error because $ is used to subset a data frame and you cannot get a subset of a function. However, you have defined a data frame named df, so df$Female should work. Is it possible that you deleted the data frame named df? If you run
ls()
you will see all of the objects you have created. Is df among them?