number8<-5+3 #sums 5 and 3 and ssaves the result into object number8 getwd()#displays working directory ?boxplot # displays help for the function boxplot vec.1<-c(1, 2,5,4,8,10.8)# Creates vector containing vec.1[5] #Displays the 5th value of vec.1 install.packages("readxl")# installs the package readxl library(readxl)# loads the package readxl people<-read_excel("people.xlsx")# imports the people dataset from csv file into people dataframe people<-read.delim2("clipboard") # imports the people dataset from clipboard into people dataframe summary(people)#diplays summary of the people dataframe class(people)# shows object type of people # [1] "data.frame" class(people$eye.color) # [1] "character" class(people$height) # [1] "numeric" quantile(people$height)# computes quantiles of height values # 0% 25% 50% 75% 100% # 160.0 174.5 180.0 185.0 200.0 people[1:3,]# selectes and displays first three rows of the people dataframe males<-people[people$sex=="M",]# Create a new dataframe containing just data on males aggregate(people$height, list(people$sex), median)#computes aggregated meadian height values for males and females tapply(people$height, list(people$sex), median)# the same with different output format hist(people$height)#Plots histogram of heights boxplot(height~sex, data=people)#Plots a boxplot showing association between sex and heights