Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda)...
-
Upload
roger-king -
Category
Documents
-
view
212 -
download
0
Transcript of Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda)...
![Page 1: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/1.jpg)
Learning R hands on
![Page 2: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/2.jpg)
Organization of Folders:
• Class Data folder has datasets (end in .csv or .rda)
• Rcode has the scripts of R commands that can cut and pasted into an R window (end in .R)
• Ppt has the powerpoints
![Page 3: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/3.jpg)
The Basics Rintro.R
• Reading in comma separated data• Listing a data set or its components• Subscripts• Sequences and combing values (: and “c”)• Creating a new data set with <-• Arithmetic in R• Applying some stats to data• Saving your work
![Page 4: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/4.jpg)
Fooling with the data RintroManipulating.R
• Subscripting to get a subset of data • Working with rows and columns• Arithmetic on a column at once
Pay attention to where the commas are!
e.g. BT2[3,5] BT2[3,] BT2[,5] BT2[,3:5] or BT2[1:10,3:5]These are all different!
![Page 5: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/5.jpg)
Plotting DataRintroPlotting.R
• Histogram hist• Adding more features to the plot• Scatterplots using plot• Box plots for several data sets boxplot • Adding text to a scatter plot• Changing the axes scales
Build a complicated plot by adding features through several simple steps
![Page 6: Learning R hands on. Organization of Folders: Class Data folder has datasets (end in.csv or.rda) Rcode has the scripts of R commands that can cut and.](https://reader031.fdocuments.net/reader031/viewer/2022020417/56649f285503460f94c410e9/html5/thumbnails/6.jpg)
Writing functionsRintroFunctions.R
• The uses for { } and ( ) • What goes in and what comes out• Listing a function• Optional arguments • Calling a function and assigning its results to a new data set • Review of R arithmetic