diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/README.md b/README.md index 859aaa9..10f9525 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # github-practice +BoomChicaBoomBoom + Practice using Git & Github * Fork a version of this repository to your Github account diff --git a/Rmarkdown001.Rmd b/Rmarkdown001.Rmd new file mode 100644 index 0000000..fbc3b44 --- /dev/null +++ b/Rmarkdown001.Rmd @@ -0,0 +1,36 @@ +--- +title: "myfristmarkdown" +author: "bakian" +date: "9/9/2020" +output: html_document +--- + +```{r} + +``` + + + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) +``` + +## R Markdown + +This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see . + +When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: + +```{r cars} +summary(cars) +``` + +## Including Plots + +You can also embed plots, for example: + +```{r pressure, echo=FALSE} +plot(pressure) +``` + +Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. diff --git a/Rnotebook001.Rmd b/Rnotebook001.Rmd new file mode 100644 index 0000000..5d01d03 --- /dev/null +++ b/Rnotebook001.Rmd @@ -0,0 +1,29 @@ +--- +title: "R Notebook" +output: html_notebook +--- + +This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code. + +Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*. + +```{r} +plot(cars) +my_data <- cars + +``` + +Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*. + +When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file). + +The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed. + + +```{r} + +``` + + + + diff --git a/Rnotebook002.Rmd b/Rnotebook002.Rmd new file mode 100644 index 0000000..9f42403 --- /dev/null +++ b/Rnotebook002.Rmd @@ -0,0 +1,70 @@ +--- +title: "R Notebook" +output: html_notebook +--- + +--- +# Source Videos +--- +#https://www.youtube.com/watch?v=gCAwHbmOqCo +#https://www.youtube.com/watch?v=1QYgccXBtrI + + + +### Load Libraries + +```{r} +library(ggplot2) +``` + +# Plots {.tabset} + +## Scatter Plot No Title + +```{r} +d21 <- (iris) + +ggplot(iris) + + +d22 <- ggplot(iris, aes(Sepal.Length, Petal.Length)) + d22 + geom_point() + + +d23 <- ggplot(iris, aes(Sepal.Length, Petal.Length, color=Species)) + d24 <- (d23 + geom_point()) + +print(d24) + +``` + +## Scatter Plot with Title +```{r} +d24 + labs(title = "My Scatter Plot") +``` + + +## Scatter Plot with Title and Axis Labels +```{r} +d24 + labs(title = "My Scatter Plot", x="Sepal Length", y="Petal Length") +``` + + + +# New Stuff {.tabset} + +Talk about it + +## 2nd Level Header + +Idea + +## New Tab Again + +Idea 2 + + + + + + diff --git a/Rnotebook002.nb.html b/Rnotebook002.nb.html new file mode 100644 index 0000000..fa1f1c6 --- /dev/null +++ b/Rnotebook002.nb.html @@ -0,0 +1,1880 @@ + + + + + + + + + + + + + +R Notebook + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +

#https://www.youtube.com/watch?v=gCAwHbmOqCo #https://www.youtube.com/watch?v=1QYgccXBtrI

+
+

Load Libraries

+ + + +
library(ggplot2)
+ + + +
+
+

Plots

+
+

Scatter Plot No Title

+ + + +

+ + + +
+
+

Scatter Plot with Title

+ + + +
d24 + labs(title = "My Scatter Plot")
+ + +

+ + + +
+
+

Scatter Plot with Title and Axis Labels

+ + + +
d24 + labs(title = "My Scatter Plot", x="Sepal Length", y="Petal Length")
+ + +

+ + +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gTGVuZ3RoIikNCmBgYA0KDQoNCg0KIyBOZXcgU3R1ZmYgey50YWJzZXR9DQoNClRhbGsgYWJvdXQgaXQNCg0KIyMgMm5kIExldmVsIEhlYWRlcg0KDQpJZGVhDQoNCiMjIE5ldyBUYWIgQWdhaW4NCg0KSWRlYSAyDQoNCg0KDQoNCg0KDQo=
+ + + +
+ + + + + + + + + + + + + + + + diff --git a/Rscript001.R b/Rscript001.R new file mode 100644 index 0000000..6ca159f --- /dev/null +++ b/Rscript001.R @@ -0,0 +1,24 @@ +#https://www.youtube.com/watch?v=rKvybSJ4nM0 + +library(tidyverse) + +grades1 <- data.frame( + First = c("Mark", "Dave", "Jackie"), + Last = c("Gingrass", "Doe", "Smith"), + Grade = c(94, 79, 68) +) + +grades2 <- tibble( + First = c("Mark", "Dave", "Jackie"), + Last = c("Gingrass", "Doe", "Smith"), + Grade = c(94, 79, 68) +) + + +grades3 <- tribble( + ~First, ~Last, ~Grade, + "Mark", "Gingrass", "94", + "Dave", "Doe", "79", + "Jackie", "Smith", "68" +) + diff --git a/Rscript002.R b/Rscript002.R new file mode 100644 index 0000000..48a609e --- /dev/null +++ b/Rscript002.R @@ -0,0 +1,22 @@ +#https://www.youtube.com/watch?v=yDZljicdLAk + +library(tidyverse) + +people <- tribble( + ~Name, + "Berj Akian", + "Stan Watts", + "George Perreault" +) + +#people %>% +# separate(Name, into = c("First", "Last"), sep = "/") -> people2 + + + +people %>% + separate(Name, into = c("First", "Last"), sep = c(" ")) %>% + head(1) + + + \ No newline at end of file diff --git a/Rscript003.R b/Rscript003.R new file mode 100644 index 0000000..9705aad --- /dev/null +++ b/Rscript003.R @@ -0,0 +1,24 @@ +#https://www.youtube.com/watch?v=wkHLIWiGLyI + +bucket <- c(1,2,3,4,5,6) + +s1 <- sample(bucket, 50, replace = TRUE) + +s2 <- sample(bucket, 5, replace = FALSE) + +s3 <- sample(runif(20, min = 10, max = 20), 3000, replace = TRUE) + + +r_num <- runif(20, min = 10, max = 20) +s4 <- sample(r_num, 3000, replace = TRUE) + + + +hist(s1) + +hist(s2) + +hist(s3) + +hist(s4) + diff --git a/Rscript004.R b/Rscript004.R new file mode 100644 index 0000000..2f2816d --- /dev/null +++ b/Rscript004.R @@ -0,0 +1,43 @@ +#https://www.youtube.com/watch?v=gCAwHbmOqCo + +library(ggplot2) + +--- +#diamonds dataset +--- +View(diamonds) +dim(diamonds) +ggplot(diamonds) + +ggplot(diamonds, aes(carat, price)) + +d01 <- ggplot(diamonds, aes(carat,price)) + d01 + geom_point() + + +d02 <- ggplot(diamonds, aes(carat,price,color=cut)) + d02 + geom_point() + + +d03 <- ggplot(diamonds, aes(carat,price,color=color)) + d03 + geom_point() + +--- +#iris dataset +--- + +View(iris) +dim(iris) +ggplot(iris) + +ggplot(iris) + +ggplot(iris, aes(Sepal.Length,Petal.Length)) + +d11 <- ggplot(iris, aes(Sepal.Length,Petal.Length)) + d11 + geom_point() + + +d12 <- ggplot(iris, aes(Sepal.Length,Petal.Length,color=Species)) + d12 + geom_point() + diff --git a/desktop.ini b/desktop.ini new file mode 100644 index 0000000..d375fae Binary files /dev/null and b/desktop.ini differ diff --git a/github-practice.Rproj b/github-practice.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/github-practice.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX