Skip to content

Submission of my class-activity-2 assignment.#2

Open
taylormwang wants to merge 1 commit intocore-methods-in-edm:masterfrom
taylormwang:master
Open

Submission of my class-activity-2 assignment.#2
taylormwang wants to merge 1 commit intocore-methods-in-edm:masterfrom
taylormwang:master

Conversation

@taylormwang
Copy link
Copy Markdown

@taylormwang taylormwang commented Sep 28, 2019

Student: Minruo Wang
UNI: mw3399
Assignment: HUDK4050 class-activity-2

Looking forward to your feedbacks & solutions!

Student: Minruo Wang
UNI: mw3399
StudentScores <- runif(100, min = 1, max = 100)
#pmax sets a maximum value, pmin sets a minimum value
StudentScores <- pmax(1, StudentScores)
StudentScores <- pmin(100, StudentScores)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is an another way of setting maximum and minimum values with a single line of code. round(pmax(1, pmin(100, rnorm(100, 75, 20))))

#sample draws a random samples from the groups vector according to a uniform distribution
StudentScores <- round(StudentScores, digits = 0)

InterestGroups <- c("sport", "music", "nature", "literature")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

InterestGroups should be randomized as well. You can use sample()

```{r boxplot}
#Make a vector of the colors from RColorBrewer

library(ggplot2)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job on using ggplot! You can also use boxplot()


```{r correlation test}
# Correlation tests using Pearson
cor.test(iris$Sepal.Length, iris$Sepal.Width, method = "pearson", use = "complete.obs")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job on using the cor.test()!


##### 10. Finally use the knitr function to generate an html document from your work. If you have time, try to change some of the output using different commands from the RMarkdown cheat sheet.

##### 11. Commit, Push and Pull Request your work back to the main branch of the repository
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent work overall! Try rendering your RMarkdown file into an HTML document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants