Lesson2 RStudio Basics Flashcards
console
lower left, with prompt to type commands
workspace
upper right panel, shows history of commands
R Markdown
Upper left panel, document
Lower right panel
plots show here, browse files, access help, manage packages
R Packages
Collections of R functions, data and compiled code in a well-defined format, we use statsr, dplyr, ggplot2
Install package commands
install.packages and install_github
Command for loading packages in working environment
library
e.g library(dplyr)
You only need to install package once but load each time you relaunch RStudio
How to run commands from either Red file or console
-click on the green arrow of the code chunk in the R Markdown(Rmd) file, or
-highlight these lines, and hit the Run button, or
-type the code in the console
command to load data
data()
eg. data(arbuthnot)
objects
as you work with R, you will create a series of objects, sometimes you will load them with data command, sometimes you create them yourself as byproduct of a computation or analysis
How to use dataviewer in the Environment
upper right window, click on name of data set that lists objects in your workspace
e.g. arbuthnot
data frame
a kind of spreadsheet or table where R stores data
dim() command
command for asking for dimension of data, eg. 82 rows and 3 columns
names()
command for asking for variable names
how is invoking R commands like math class
invoking R commands means supplying a function with some number of arguments, eg. such as a single argument of the name of a data frame