120 likes | 347 Views
Data Manipulation. Steve Allison allisons@uci.edu. Language. R… is an interpreted language is highly interactive is case sensitive ( mydata ≠ Mydata ≠ myData ) stores data in a variety of classes (more on this…) language is fully documented ( available here ) and open source.
E N D
Data Manipulation Steve Allison allisons@uci.edu
Language • R… • is an interpreted language • is highly interactive • is case sensitive (mydata ≠ Mydata ≠ myData) • stores data in a variety of classes (more on this…) • language is fully documented (available here) and open source
Coding vs. Menus • Efficiency of complicated procedures • Ease of reproducing output • Readability • Customization
VocabulaRy • Object • Function • Workspace • Working directory • History • Package • Call
A brief tour of RStudio RStudio is a GUI for R • Panes (Source, Console, Workspace, Utilities) • Code completion • Projects Check out the screencast at http://rstudio.org/
Rules for naming data structures • Must begin with a letter, no spaces, no _ good.name1 vs. 2_poor name • Assignment syntax: <- (not =) • Formally reserved words if else repeat while function for in next break TRUE FALSE NULL InfNaN NA NA_integer_ NA_real_ NA_complex_ NA_character_ • Informally reserved words data file formula summary
Packages • “Currently, the CRAN package repository features 3732 available packages.”
Many Types of Data Import • User input • Text files • Excel files (uses gdata or xlsx) • Others
Data Classes • Vectors • Matrices • Arrays • Data Frames • Lists • Factors • Various model objects
Finding Help • Calling a help file: ?seq #function name help(aov) #function name ??tukey #fuzzy match example(lm) #worked example • Online resources • Quick R • UCLA stats department • CRAN • R for SAS Users • UseR!