2-GettingStartedWithR

G func1on names if in doubt check existspi 1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t •  How do we save the result? •  How do we use the output as input to another expression? Output and Assignment •  We can assign the result of the computa1on to a variable, e.g., named x: > x = 10^(15 / 3 – 2) •  We can use x as an input in another expression > sqrt(x)! •  To see the value of a variable type the variable name at the prompt and hit return > x! Output and Assignment •  = and <- are both valid assignment operators x <- 10^(15 / 3 – 2) •  Choose one and use it consistently •  As we’ll see == means something completely different. Variables •  Variables have a name and a value •  To access the value we use the name •  Variables allow us to: –  Store a value without needing to recompute it –  Write a general expression, e.g. sqrt(a^2 + b^2)! –  Reduce...
View Full Document

This document was uploaded on 02/16/2014 for the course STATISTICS 3026 at Columbia.

Ask a homework question - tutors are online