?rnorm #help query
args(lm) ##gets args
rm(list=ls()) #clean the workspace
getwd() #Where are you now?
setwd("/Users/YOU/Desktop/R/") #Set the directory
list.files() # list files in your working directory
ls() #list variables in current workspace.
dataframe = read.csv("data.csv") #has to be in your working directory
head(dataframe) #Look at the first few lines
tail(dataframe) #Look at the last few lines
dim(dataframe) #check all the columns/rows are there. Should be 10 rows and 2 columns
str(dataframe) #check data types. e.g. student numbers sholud be read as "factor", not integer
group1 = dataframe[dataframe$type == "walk OR cycle only", ]
group2 = dataframe[dataframe$type == "train and or bus", ]
counts = table(dataframe) #count frequency of each answer
barplot(counts, col=c("orange", "red"), main = "Graph Title", xlab = "penguins", ylab="giraffes", beside=TRUE, las = 0)