-
Notifications
You must be signed in to change notification settings - Fork 20
Exercise 7 Camden Arnold #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
carnold33
wants to merge
2
commits into
qtran4:main
Choose a base branch
from
carnold33:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| sample(1:145, 25, replace=FALSE) | ||
| sample(1:40, 5, replace=FALSE) | ||
| sample(41:56, 5, replace=FALSE) | ||
| sample(57:90, 5, replace=FALSE) | ||
| sample(91:145, 5, replace=FALSE) | ||
| > install.packages("swirl") | ||
| install.packages("swirl") | ||
| library("swirl") | ||
| swirl() | ||
| swirl::install_course("R Programming") | ||
| library("swirl") | ||
| swirl() | ||
| 5+7 | ||
| x <- 5 + 7 | ||
| x | ||
| y <- x-3 | ||
| y | ||
| z <- c(1.1, 9, 3.14) | ||
| ?c | ||
| z | ||
| c(z, 555, z) | ||
| z * 2 + 100 | ||
| my_sqrt <- sqrt(z - 1) | ||
| my_sqrt | ||
| my_div <- z / my_sqrt | ||
| my_div | ||
| c(1, 2, 3, 4) + c(0. 10) | ||
| c(1, 2, 3, 4) + c(0, 10) | ||
| c(1, 2, 3, 4) + c(0, 10, 100) | ||
| z * 2 + 1000 | ||
| my_div | ||
| 1:20 | ||
| pi:10 | ||
| 15:1 | ||
| ?`:` | ||
| seq(1, 20) | ||
| seq(0, 10, by=0.5) | ||
| seq(5,10, length=30) | ||
| seq(5, 10, length=30) | ||
| my_seq <- seq(5, 10, length=30) | ||
| length(my_seq) | ||
| 1:length(my_seq) | ||
| seq(along.with = my_seq) | ||
| seq_along(my_seq) | ||
| rep(0, times = 40) | ||
| rep(c(0, 1, 2), times = 10) | ||
| rep(c(0, 1, 2), each = 10) | ||
| num_vect <- c(0.5, 55, -10, 6) | ||
| tf <- num_vect < 1 | ||
| tf | ||
| num_vect >= 6 | ||
| my_char <- "My", "name", "is" | ||
| my_char <- "My" "name" "is" | ||
| my_char <- "My", "name", "is". | ||
| my_char <- "My" , "name" , "is". | ||
| my_char <- "My","name","is" | ||
| my_char <- c("My", "name", "is") | ||
| my_char | ||
| paste(my_char, collapse = " ") | ||
| c(my_char, "Camden"). | ||
| c(my_char, "Camden") | ||
| my_name <- c(my_char, "Camden") | ||
| my_name | ||
| paste(my_name, collapse = " ") | ||
| paste("Hello", "world!", sep = " ") | ||
| paste(c("X", "Y", "Z"), sep = " ") | ||
| paste(1:3, c("X", "Y", "Z"), sep = "") | ||
| paste(LETTERS, 1:4, sep = "-") | ||
| swirl() | ||
| library("swirl") | ||
| swirl() | ||
| num_vect <- c(0.5, 55, -10, 6) | ||
| num_vect < 1 | ||
| tf <- num_vect <1 | ||
| tf | ||
| num_vect >= 6 | ||
| my_char <- c("My", "name", "is") | ||
| my_char | ||
| paste(my_char, collapse = " ") | ||
| my_name <- c(my_char, "Camden") | ||
| my_name | ||
| paste (my_name, collapse = " ") | ||
| paste("Hello", "world!", sep = " ") | ||
| paste(1:3, c("X", "Y", "Z") sep = "") | ||
| paste(1:3 c("X", "Y", "Z") sep = "") | ||
| paste(c("X", "Y", "Z") sep = "") | ||
| paste (1:3, c("X", "Y", "Z") sep = "") | ||
| paste (c("X", "Y", "Z"), sep = "") | ||
| paste(1:3, c("X", "Y", "Z"), sep = "") | ||
| paste(LETTERS, 1:4, sep = "-") | ||
| library("swirl") | ||
| swirl() | ||
| my_vector <- 1:20 | ||
| my_vector | ||
| dim(my_vector) | ||
| length(my_vector) | ||
| dim(my_vector) <- c(4.5) | ||
| dim(my_vector) <- c(4, 5) | ||
| dim(my_vector) | ||
| attributes(my_vector) | ||
| my_vector | ||
| class(my_vector) | ||
| my_matrix <- my_vector | ||
| ? matrix() | ||
| info() | ||
| ?matrix | ||
| my_matrix2 <- matrix(1:20,4,5) | ||
| identical(my_matrix, my_matrix2) | ||
| patients <- vector("Bill", "Gina", "Kelly", "Sean") | ||
| help() | ||
| help(vector) | ||
| patients <- c("Bill", "Gina", "Kelly", "Sean") | ||
| cbind(patients, my_matrix) | ||
| my_data <- data.frame(patients, my_matrix) | ||
| my_data | ||
| class(my_data) | ||
| c("patient", "age", "weight", "bp", "rating", "test") | ||
| cnames <- c("patient", "age", "weight", "bp", "rating", "test") | ||
| colnames(cnames) | ||
| colnames(my_data) <- cnames | ||
| my_data | ||
| ls() | ||
| class(plants) | ||
| dim(plants) | ||
| nrow(plants) | ||
| ncol(plants) | ||
| object.size(plants) | ||
| names(plants) | ||
| head(plants) | ||
| head(plants) | ||
| head(plants, 10) | ||
| tail(plants, 15) | ||
| summary(plants) | ||
| table(plants$Active_Growth_Period) | ||
| str(plants) | ||
| data(cars) | ||
| help(cars) | ||
| head(cars) | ||
| plot(cars) | ||
| help(plot) | ||
| plot(x = cars$speed, y = cars$dist) | ||
| plot(x = cars$dist, y = cars$speed) | ||
| plot(x = cars$speed, y = cars$dist) | ||
| plot(x = cars$speed, y = cars$dist, xlab = "Speed") | ||
| plot(x = cars$speed, y = cars$dist, xlab = "Speed", ylab = "Stopping Distance") | ||
| plot(x = cars$speed, y = cars$dist, ylab = "Stopping Distance") | ||
| plot(x = cars$speed, y = cars$dist, xlab = "Speed", ylab = "Stopping Distance") | ||
| plot(x = cars$speed, y = cars$dist, main = "My Plot") | ||
| plot(cars, main = "My Plot") | ||
| plot(cars, sub = "My Plot Subtitle") | ||
| plot(cars, col = 2) | ||
| plot(cars, xlim = c(10,15)) | ||
| plot(cars, pch = 2) | ||
| load(mtcars) | ||
| mtcars | ||
| data(mtcars) | ||
| help(boxplot) | ||
| boxplot(formula = pmg ~ cyl, data = mtcars) | ||
| boxplot(formula = mpg ~ cyl, data = mtcars) | ||
| hist(c(mtcars$mpg)) | ||
| hist(mtcars$mpg) | ||
| #Converts iris.csv into tab-delimited .txt file | ||
| write.table(read.csv("iris.csv"), file="iris.txt", sep="\t", row.names = FALSE, col.names = TRUE) | ||
| setwd("~/Desktop/classes_fa22/biocomputing/homeworks/Exercise07") | ||
| #Converts iris.csv into tab-delimited .txt file | ||
| write.table(read.csv("iris.csv"), file="iris.txt", sep="\t", row.names = FALSE, col.names = TRUE) | ||
| #Creates a list to add elements to | ||
| finalList=list() | ||
| #Adds a vector with length 10 containing 100, 200, ... 1000 to list | ||
| finalList$element1=seq(from=100,to=1000,by=100) | ||
| #Adds a two-row, two-column df with team names and score of Notre Dame football game to list | ||
| TEAM=c("ND","UNLV") | ||
| SCORE=c(44,21) | ||
| finalList$element2=data.frame(TEAM,SCORE,stringsAsFactors=FALSE) | ||
| #Adds the number 999 to list | ||
| finalList$element3=999 | ||
| #Adds a 10-row, 5-column matrix with integer from 1-50 to list | ||
| finalList$element4=matrix(c(1:50),nrow=10,ncol=5) | ||
| #Adds a vector containing three letters to list | ||
| finalList$element5=c("a","b","c") | ||
| finalList |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #Assumes working directory is set to Exercise07 folder | ||
|
|
||
| #Q1 | ||
|
|
||
| #Converts iris.csv into tab-delimited .txt file | ||
| write.table(read.csv("iris.csv"), file="iris.txt", sep="\t", row.names = FALSE, col.names = TRUE) | ||
|
|
||
| #Q2 | ||
|
|
||
| #Creates a list to add elements to | ||
| finalList=list() | ||
|
|
||
| #Adds a vector with length 10 containing 100, 200, ... 1000 to list | ||
| finalList$element1=seq(from=100,to=1000,by=100) | ||
|
|
||
| #Adds a two-row, two-column df with team names and score of Notre Dame football game to list | ||
| TEAM=c("ND","UNLV") | ||
| SCORE=c(44,21) | ||
| finalList$element2=data.frame(TEAM,SCORE,stringsAsFactors=FALSE) | ||
|
|
||
| #Adds the number 999 to list | ||
| finalList$element3=999 | ||
|
|
||
| #Adds a 10-row, 5-column matrix with integer from 1-50 to list | ||
| finalList$element4=matrix(c(1:50),nrow=10,ncol=5) | ||
|
|
||
| #Adds a vector containing three letters to list | ||
| finalList$element5=c("a","b","c") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species" | ||
| 5.1 3.5 1.4 0.2 "setosa" | ||
| 4.9 3 1.4 0.2 "setosa" | ||
| 4.7 3.2 1.3 0.2 "setosa" | ||
| 4.6 3.1 1.5 0.2 "setosa" | ||
| 5 3.6 1.4 0.2 "setosa" | ||
| 5.4 3.9 1.7 0.4 "setosa" | ||
| 4.6 3.4 1.4 0.3 "setosa" | ||
| 5 3.4 1.5 0.2 "setosa" | ||
| 4.4 2.9 1.4 0.2 "setosa" | ||
| 4.9 3.1 1.5 0.1 "setosa" | ||
| 5.4 3.7 1.5 0.2 "setosa" | ||
| 4.8 3.4 1.6 0.2 "setosa" | ||
| 4.8 3 1.4 0.1 "setosa" | ||
| 4.3 3 1.1 0.1 "setosa" | ||
| 5.8 4 1.2 0.2 "setosa" | ||
| 5.7 4.4 1.5 0.4 "setosa" | ||
| 5.4 3.9 1.3 0.4 "setosa" | ||
| 5.1 3.5 1.4 0.3 "setosa" | ||
| 5.7 3.8 1.7 0.3 "setosa" | ||
| 5.1 3.8 1.5 0.3 "setosa" | ||
| 5.4 3.4 1.7 0.2 "setosa" | ||
| 5.1 3.7 1.5 0.4 "setosa" | ||
| 4.6 3.6 1 0.2 "setosa" | ||
| 5.1 3.3 1.7 0.5 "setosa" | ||
| 4.8 3.4 1.9 0.2 "setosa" | ||
| 5 3 1.6 0.2 "setosa" | ||
| 5 3.4 1.6 0.4 "setosa" | ||
| 5.2 3.5 1.5 0.2 "setosa" | ||
| 5.2 3.4 1.4 0.2 "setosa" | ||
| 4.7 3.2 1.6 0.2 "setosa" | ||
| 4.8 3.1 1.6 0.2 "setosa" | ||
| 5.4 3.4 1.5 0.4 "setosa" | ||
| 5.2 4.1 1.5 0.1 "setosa" | ||
| 5.5 4.2 1.4 0.2 "setosa" | ||
| 4.9 3.1 1.5 0.2 "setosa" | ||
| 5 3.2 1.2 0.2 "setosa" | ||
| 5.5 3.5 1.3 0.2 "setosa" | ||
| 4.9 3.6 1.4 0.1 "setosa" | ||
| 4.4 3 1.3 0.2 "setosa" | ||
| 5.1 3.4 1.5 0.2 "setosa" | ||
| 5 3.5 1.3 0.3 "setosa" | ||
| 4.5 2.3 1.3 0.3 "setosa" | ||
| 4.4 3.2 1.3 0.2 "setosa" | ||
| 5 3.5 1.6 0.6 "setosa" | ||
| 5.1 3.8 1.9 0.4 "setosa" | ||
| 4.8 3 1.4 0.3 "setosa" | ||
| 5.1 3.8 1.6 0.2 "setosa" | ||
| 4.6 3.2 1.4 0.2 "setosa" | ||
| 5.3 3.7 1.5 0.2 "setosa" | ||
| 5 3.3 1.4 0.2 "setosa" | ||
| 7 3.2 4.7 1.4 "versicolor" | ||
| 6.4 3.2 4.5 1.5 "versicolor" | ||
| 6.9 3.1 4.9 1.5 "versicolor" | ||
| 5.5 2.3 4 1.3 "versicolor" | ||
| 6.5 2.8 4.6 1.5 "versicolor" | ||
| 5.7 2.8 4.5 1.3 "versicolor" | ||
| 6.3 3.3 4.7 1.6 "versicolor" | ||
| 4.9 2.4 3.3 1 "versicolor" | ||
| 6.6 2.9 4.6 1.3 "versicolor" | ||
| 5.2 2.7 3.9 1.4 "versicolor" | ||
| 5 2 3.5 1 "versicolor" | ||
| 5.9 3 4.2 1.5 "versicolor" | ||
| 6 2.2 4 1 "versicolor" | ||
| 6.1 2.9 4.7 1.4 "versicolor" | ||
| 5.6 2.9 3.6 1.3 "versicolor" | ||
| 6.7 3.1 4.4 1.4 "versicolor" | ||
| 5.6 3 4.5 1.5 "versicolor" | ||
| 5.8 2.7 4.1 1 "versicolor" | ||
| 6.2 2.2 4.5 1.5 "versicolor" | ||
| 5.6 2.5 3.9 1.1 "versicolor" | ||
| 5.9 3.2 4.8 1.8 "versicolor" | ||
| 6.1 2.8 4 1.3 "versicolor" | ||
| 6.3 2.5 4.9 1.5 "versicolor" | ||
| 6.1 2.8 4.7 1.2 "versicolor" | ||
| 6.4 2.9 4.3 1.3 "versicolor" | ||
| 6.6 3 4.4 1.4 "versicolor" | ||
| 6.8 2.8 4.8 1.4 "versicolor" | ||
| 6.7 3 5 1.7 "versicolor" | ||
| 6 2.9 4.5 1.5 "versicolor" | ||
| 5.7 2.6 3.5 1 "versicolor" | ||
| 5.5 2.4 3.8 1.1 "versicolor" | ||
| 5.5 2.4 3.7 1 "versicolor" | ||
| 5.8 2.7 3.9 1.2 "versicolor" | ||
| 6 2.7 5.1 1.6 "versicolor" | ||
| 5.4 3 4.5 1.5 "versicolor" | ||
| 6 3.4 4.5 1.6 "versicolor" | ||
| 6.7 3.1 4.7 1.5 "versicolor" | ||
| 6.3 2.3 4.4 1.3 "versicolor" | ||
| 5.6 3 4.1 1.3 "versicolor" | ||
| 5.5 2.5 4 1.3 "versicolor" | ||
| 5.5 2.6 4.4 1.2 "versicolor" | ||
| 6.1 3 4.6 1.4 "versicolor" | ||
| 5.8 2.6 4 1.2 "versicolor" | ||
| 5 2.3 3.3 1 "versicolor" | ||
| 5.6 2.7 4.2 1.3 "versicolor" | ||
| 5.7 3 4.2 1.2 "versicolor" | ||
| 5.7 2.9 4.2 1.3 "versicolor" | ||
| 6.2 2.9 4.3 1.3 "versicolor" | ||
| 5.1 2.5 3 1.1 "versicolor" | ||
| 5.7 2.8 4.1 1.3 "versicolor" | ||
| 6.3 3.3 6 2.5 "virginica" | ||
| 5.8 2.7 5.1 1.9 "virginica" | ||
| 7.1 3 5.9 2.1 "virginica" | ||
| 6.3 2.9 5.6 1.8 "virginica" | ||
| 6.5 3 5.8 2.2 "virginica" | ||
| 7.6 3 6.6 2.1 "virginica" | ||
| 4.9 2.5 4.5 1.7 "virginica" | ||
| 7.3 2.9 6.3 1.8 "virginica" | ||
| 6.7 2.5 5.8 1.8 "virginica" | ||
| 7.2 3.6 6.1 2.5 "virginica" | ||
| 6.5 3.2 5.1 2 "virginica" | ||
| 6.4 2.7 5.3 1.9 "virginica" | ||
| 6.8 3 5.5 2.1 "virginica" | ||
| 5.7 2.5 5 2 "virginica" | ||
| 5.8 2.8 5.1 2.4 "virginica" | ||
| 6.4 3.2 5.3 2.3 "virginica" | ||
| 6.5 3 5.5 1.8 "virginica" | ||
| 7.7 3.8 6.7 2.2 "virginica" | ||
| 7.7 2.6 6.9 2.3 "virginica" | ||
| 6 2.2 5 1.5 "virginica" | ||
| 6.9 3.2 5.7 2.3 "virginica" | ||
| 5.6 2.8 4.9 2 "virginica" | ||
| 7.7 2.8 6.7 2 "virginica" | ||
| 6.3 2.7 4.9 1.8 "virginica" | ||
| 6.7 3.3 5.7 2.1 "virginica" | ||
| 7.2 3.2 6 1.8 "virginica" | ||
| 6.2 2.8 4.8 1.8 "virginica" | ||
| 6.1 3 4.9 1.8 "virginica" | ||
| 6.4 2.8 5.6 2.1 "virginica" | ||
| 7.2 3 5.8 1.6 "virginica" | ||
| 7.4 2.8 6.1 1.9 "virginica" | ||
| 7.9 3.8 6.4 2 "virginica" | ||
| 6.4 2.8 5.6 2.2 "virginica" | ||
| 6.3 2.8 5.1 1.5 "virginica" | ||
| 6.1 2.6 5.6 1.4 "virginica" | ||
| 7.7 3 6.1 2.3 "virginica" | ||
| 6.3 3.4 5.6 2.4 "virginica" | ||
| 6.4 3.1 5.5 1.8 "virginica" | ||
| 6 3 4.8 1.8 "virginica" | ||
| 6.9 3.1 5.4 2.1 "virginica" | ||
| 6.7 3.1 5.6 2.4 "virginica" | ||
| 6.9 3.1 5.1 2.3 "virginica" | ||
| 5.8 2.7 5.1 1.9 "virginica" | ||
| 6.8 3.2 5.9 2.3 "virginica" | ||
| 6.7 3.3 5.7 2.5 "virginica" | ||
| 6.7 3 5.2 2.3 "virginica" | ||
| 6.3 2.5 5 1.9 "virginica" | ||
| 6.5 3 5.2 2 "virginica" | ||
| 6.2 3.4 5.4 2.3 "virginica" | ||
| 5.9 3 5.1 1.8 "virginica" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+2