~/ learn/ afm-113/ cards/ R as a calculator
1 of 8

Type the transcript that builds the eight days-to-pay values, reads the second, and drops the second.

Type the transcript that builds the eight days-to-pay values, reads the second, and drops the second.

Answer

> days <- c(12, 30, 7, 45, 18, 22, 9, 15) > days[2] [1] 30 > days[-2] [1] 12 7 45 18 22 9 15

c() combines; [2] is the second element (indexing starts at 1); [-2] returns everything except the second. The extra space before 7 is column alignment in R's printing.

S21 W1 handout (R component, shape only); every transcript line is the verbatim console text of a real Rscript run (2026-09-17)

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/b45bc783-61a7-46b5-9a20-39bfb9fa65b1/flashcard utf-8 LF