Summing certain parts of columns in R studio

Welcome to the forum,

Screenshots are not very useful but here is a simple example .

dat1 <- data.frame(aa = sample(1:50, 20), bb = LETTERS[1:20])                              
sum(dat1[1:15, "aa"])

You might find this useful: FAQ