a<-4 b<-6 a+b # we can add comments getwd() # Intead of the following command you can use the above menu to set #the working directory (Session/Working directory) setwd("") a<-1:5 a b<-c( 1,2,2,4,5,1 ) b mode(b) length(b) b[3] e<-b[2:4] e e<-b[c(2,3,4)] e b b>3 d<-b[b>3] d ourlist<-list( 1,"hello",TRUE ) if(ourlist[3]){ print("success") } if(ourlist[[3]]){ print("success") } ?matrix something<-matrix(1:6,2,3) something something2<-matrix(data=1:6,ncol=3,nrow=2) something2 nrow something3<-matrix(1:6,ncol=3,nrow<-2) something3 ncol nrow library(stats) library(graphics) library(utils) ?runif auxiliary1<-runif(500,0.5,6.5) auxiliary1 round(3.3) dice<-round(auxiliary1) dice toexport<-data.frame(auxiliary1,dice) View(toexport) names(toexport) names(toexport)<-c("apple","orange") toexport[3,2] toexport[3,] toexport[,2] toexport$orange write.table(toexport,file="classroomtask.csv", sep=";",row.names=FALSE) ?read.table cholesterol<-read.table("cholestr.txt",header=TRUE) View(cholesterol) t.test(cholesterol$Day2,mu=260)