{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

spluscode

# spluscode - http/lib.stat.cmu.edu/S/cheatsheet S Cheatsheet...

This preview shows pages 1–4. Sign up to view the full content.

http://lib.stat.cmu.edu/S/cheatsheet 1 of 6 10/2/2007 8:18 PM S Cheatsheet Compiled by: Barry W. Brown Department of Biomathematics, Box 237 University of Texas M. D. Anderson Cancer Center 1515 Holcombe Blvd Houston, TX 77030 [email protected] ° I. S EXPRESSIONS A. Literals number 1 1.1 1.1e10 string 'string' or "string" name comment # string. function (formals) expr function(args){defn} B. Calls expr infix expr expr %anything% expr unary expr expr ( arglist ) expr [ arglist ] expr [[ arglist ]] expr \$ fname C. Assignment expr <- expr expr_expr expr -> expr expr <<- expr Forces write to disk from within a function D. Conditional if ( expr ) expr if ( expr ) expr else expr E. Iteration repeat expr

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
http://lib.stat.cmu.edu/S/cheatsheet 2 of 6 10/2/2007 8:18 PM while ( expr ) expr for ( Name in expr ) expr F. Flow break next return ( expr ) ( expr ) { exprlist } ° II. ARITHMETIC OPERATORS * Multiply + Add - Subtract / Divide ^ Exponentiation %% Remainder or modulo operator %*% Matrix multiplication operator %/% Integer divide %c% crossproduct m1 %c% m2 is t(m1) %*% m2 %o% Outer Product III. RELATIONAL OPERATORS != Not-equal-to < Less-than <= Less-than-or-equal-to == Equal > Greater-than >= Greater-than-or-equal-to ° IV. LOGICAL OPERATORS ! Not | Or (Use with arrays or matrices) || Shortcut Or (Don't use with arrays or matrices) & And (Use with arrays or matrices) && Shortcut And (Don't use with arrays or matrices)
http://lib.stat.cmu.edu/S/cheatsheet

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}