Skip to content
Open
Show file tree
Hide file tree
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
Binary file added .RData
Binary file not shown.
132 changes: 132 additions & 0 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
?matrix
setwd("~/")
source("~/.active-rstudio-document")
View(data)
View(data)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
a = c(1:10)
a = a^3
sqrt(-5)
max(c(1,5,9))
x<-(c(1:10))^3
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
halfval <- function(x,y){
z <- min(x)/y
return(z)
}
halfval(c(1,5,9),4)
halfval <- function(x,y=2){
z <- min(x)/y
return(z)
}
halfval(c(1,5,9))
View(halfval)
View(halfval)
View(halfval)
View(halfval)
test <- function(x){
print(x)
}
test('hi')
?read.table
setwd("~/My Files/Notes/NDU/Coursework/Biocomputing/Biocomp_tutorial10")
source("~/.active-rstudio-document")
View(data)
View(data)
source("~/.active-rstudio-document")
View(data)
View(data)
View(data)
View(data)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
View(data_UW)
View(data_UW)
View(data)
View(data)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
length(data_UW)
source("~/.active-rstudio-document")
data[1,3]
View(data)
View(data)
source("~/.active-rstudio-document")
View(data)
View(data)
View(data_UW)
View(data_UW)
rm(list = ls())
source("~/.active-rstudio-document")
View(data_UW)
View(data_UW)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
View(data)
View(data)
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
View(data)
View(data)
source("~/.active-rstudio-document")
source("~/My Files/Notes/NDU/Coursework/Biocomputing/Biocomp_tutorial10/Q1_SummaryPlot.R")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
source("~/.active-rstudio-document")
22 changes: 22 additions & 0 deletions Q1_SummaryPlot.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#import the data as a dataframe
data <- read.table(file = "UWvMSU_1-22-13.txt", header = TRUE)

#divide the dataframe into two sets, UW and MSU
data_UW <- data[data$team=="UW",]
data_MS <- data[data$team=="MSU",]

#Create cumulative sum data
cum_UW <- c(data_UW[1,3])
for (i in 1:nrow(data_UW)-1){
cum_UW <- append(cum_UW,data_UW[i+1,3] + cum_UW[i])
}
cum_MS <- c(data_MS[1,3])
for (i in 1:nrow(data_MS)-1){
cum_MS <- append(cum_MS,data_MS[i+1,3] + cum_MS[i])
}

#Plot
plot(data_MS$time,cum_MS,type="o", col="blue", xlab = 'time', ylab ='score')
points(data_UW$time,cum_UW,type="o", col="red")
legend("topleft",legend=c("MSU","UW"), col=c("blue","red"),pch=c("o"), lty = 1)

23 changes: 23 additions & 0 deletions guessMyNumber.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#choose the random number
num <- sample(1:100,1)

#Ask for input
attempt <- 1
guess <- strtoi(readline(prompt="Take a guess: "))
while(guess != num & attempt < 10){
if (guess > num){
print("lower")
guess <- strtoi(readline(prompt="Take a guess: "))
attempt <- attempt + 1
}
else if(guess < num){
print("higher")
guess <- strtoi(readline(prompt="Take a guess: "))
attempt <- attempt + 1
}
}
if(guess == num){
print('Correct')
}else{
print('End of guesses')
}