Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Keenan_Exercise07.R
Original file line number Diff line number Diff line change
@@ -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)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+2