I am trying to get the mean of the first five elements in a column within a dataframe using the summarize function from the dplyr package. Right now, I am able to get the mean of the entire column but I want to restrict the mean() function to only calculate the first five values in the column.
mean_5_films <- summarize(
genre_df,
average = mean(vote_average, na.rm = TRUE)
)