> 32*27
[1] 864A Slower Introduction to R
UCSF Library
Thursday, October 9, 2025


>) is called a prompt (“it’s your turn”), and is a space for you to write messages to your computer.


> symbol in the R console?*) indicates multiplication^ for exponentiation* for multiplication/ for division+ for addition- for subtractionpi is a special value that is built in to R3- in the console and press the return/enter key on your keyboard. Press return/enter key again and again and again. Notice that the console is displaying a + sign rather than the usual > symbol. The + sign indicates that your computer thinks you’re not done with your instruction. It’s occurring here because 3- suggests an incomplete instruction to do subtraction. To complete the instruction, type in any number (for example, 19). You should see the prompt again.3- in the console again and press return/enter key on your keyboard. Press return/enter key again and again and again. Notice the + signs. This time, press the escape (esc) key on your keyboard to cancel the instruction. You should see the prompt again.sqrt: the name of an R function (more on this in a moment), indicating that we want to take the square root of a number81: the number we want the square root ofelephant ≠ ELEphaNT)sqrt() for square rootsabs() for absolute valuesexp() for powers of \(e\) (I don’t expect you to know what this is)120 over and over again120: a number I want to store<-: a left arrow, indicating that I want to store the numbernormal_systolic_upper: a name that I picked that I can use to refer to the number
120: what I want to put in a jar<-: the action of putting something in a jarnormal_systolic_upper: a label that I place on the jarnormal_systolic_upper in this example) is known as an object_ or .c() functionc() function:c() functionnormal_systolic_upper from the vector of measurements:normal_systolic_upper gets subtracted from each value of the vectorA common upper threshold for “optimal” LDL cholesterol is 100 mg/dL. Store this value using object assignment, giving the object some arbitrary name, like LDL.cut or ldl_optimal_upper.
Retrieve the object at the console, to verify that the object assignment worked.
Use the object you defined to calculate how much higher a measurement of 162 mg/dL is than the optimal threshold.