From 77f5537686c402456cb94f75ccb849885fd2373f Mon Sep 17 00:00:00 2001 From: johnkeenan2929 <114720243+johnkeenan2929@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:31:56 -0400 Subject: [PATCH] Add files via upload --- Keenan_Exercise07.R | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Keenan_Exercise07.R diff --git a/Keenan_Exercise07.R b/Keenan_Exercise07.R new file mode 100644 index 0000000..b8585b6 --- /dev/null +++ b/Keenan_Exercise07.R @@ -0,0 +1,22 @@ +#Problem 1 +#Load in the iris data +iris <- read.csv('iris.csv') +#write it to a txt file with tab delimitors +write.table(iris, file="iris.txt", sep='\t', row.names = TRUE, col.names = TRUE) + +#Problem 2 +#create vector length 10 with 100, 200,...,1000 +v1 <- c(100,200,300,400,500,600,700,800,900,1000) +#create a data frame with the Notre Dame football score +df1 <- data.frame(c('Notre Dame','Syracuse'), c(41,24)) +#the number 999 +num1 <- 999 +#create a 10x5 matrix with 1-50 +mat1 <- matrix(1:50, nrow = 10, ncol = 5) +#create a vector with 3 letters +v2 <- c("J", "M", "K") +#put all of these into a list of length 5 +list1 <- list(v1, df1, num1, mat1, v2) +#check to see that the length is 5 +length(list1) +