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
23 changes: 23 additions & 0 deletions Exercise7Script.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#1 Convert comma-delimited iris.csv file to a tab-delimited version named iris.txt
#Set working directory
setwd("/Users/avivalund/Desktop/Exercise07")
#Read iris.csv file
Iris_data <- read.csv(file = "iris.csv", header = FALSE)
write.table(Iris_data,"iris.txt",row.names=FALSE,sep="\t")



#2: Create a list of length 5
#a vector with length 10 containing 100,200,...1000
hundrds <- seq(from=100, to=1000, by=100)
#a two-row, two-column data frame with the team names
#and final score from last week's Notre Dame football game
fball <- data.frame(teams=c("NotreDame", "Syracuse"), scores=c("41", "24"))
#the number 999
nmbr <- as.numeric("999")
#a 10-row, 5-column matrix containing integers from 1 to 50
matrx <- matrix(data=1:50, nrow=10, ncol=5)
#a vector containing three letters
lettrs <-("moo")
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.

three letters, not a word with three letters

#create a unified list
mylist <- list(hundrds, fball, nmbr, matrx, lettrs)
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.

1.75