2-GettingStartedWithR

How do we use the output as input to another

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: ressions? •  •  •  •  •  White space: Atomic Tokens Quota1on Marks Naming Conven1ons New Line 22 vs 2 2 + - * / ^! ; end of line # comment “Hi” or ‘Bye’ not “My’! x2 not 2x! How does R parse expressions? •  New Line Order of Opera1ons Order of opera1ons is what you expect: •  exponen1a1on first, followed by mul1plica1on and division, then addi1on and subtrac1on; •  le4 to right; •  parentheses override order Try It •  Write the following as an R expression: power(10, subtract(divide(15,3),2)) •  Write the following as an R expression: 6−2 2 3 •  Circle the tokens in the following R expression cat = (1 + x2)^24! We all make mistakes in wri1ng code Understanding how R parses expressions will help you fix them Variables in R Output and Assignment When we evaluate an expression, R prints the results to the screen as outpu...
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