R errors and exceptions
Handle invalid entries, missing records, and interrupted work. Follow each failure from the input that triggers it to a response the user can act on.
Input and validation
- grepl and strtoiReject a mistyped order quantity
- is.integerCheck the type of an imported fare
- is.naPrint a label when the phone number is missing
State and collections
- Checked list indexingFind a seat after the coach changes
- Zero denominator guardSplit an equipment fee across a class
- length before extractionCall the next person at the clinic
Files and streams
- file.existsOpen the first receipt of the day
- readBin and lengthRead a stock count from a short record