> 32*27
[1] 864A Slower Introduction to R
UCSF Library
Friday, October 2, 2026


>) 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 returnreturn or enterenter key on your keyboard. Press returnreturn or enterenter 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 the returnreturn or enterenter key on your keyboard. Press returnreturn or enterenter again and again and again. Notice the + signs. This time, press escesc 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 ofsqrt() function, the request is, conceptually: “hi computer, find the square root of this number, or this set of numbers”elephant ≠ ELEphaNTsqrt() for square rootsabs() for absolute valuesexp() for powers of \(e\)10^5)27113508 twice27113508 twice introduces the possibility of human error27113508: a number I want to store<-: a left arrow, indicating that I want to store the numberpopsize: a name that I picked that I can use to refer to the number27113508: what I want to put in a jar 🫘<-: the action of putting something in a jar ⤵️ 🫙popsize: a label that I place on the jar 🏷️
popsize in this example) is known as an object_ or .A 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.