Today starts my attempt at sharing my R journey with the world! I have been learning R off and on now since late 2019, I have begun to take it much more serious as I work through my Data Analytics class at UCF. My love for all things numbers and graphs has really blossomed, and I am choosing to share that love with anyone who cares to read. I will not claim to be the best at R, or any programming for that matter, but these are my attempts. Each post in this serious will be replicated a graph created in Tableau from the book Tableau for Healthcare. Todays graph is a simple horizontal bar chart, in transferring to both a new blog site and computer I have unfortunately lost the original bar graph, but trust me the one I created looks just like it.
b1 <- ds %>%
+ggplot(mapping =aes(x =reorder(type_of_care,total_patient_falls_rate ) , y = total_patient_falls_rate)) +
+geom_col(fill ="#2b83ba") +
+coord_flip() +
+scale_y_continuous(breaks =NULL) +
+theme(axis.ticks =element_blank()) +
+labs(title ="Rate of Patient Falls (per 1,000 Pateint Days)\nby Type of Care for FY2017"
+ ,x =NULL
+ ,y =NULL
+ ) +
+theme_classic() +
+geom_text(aes(label =format(total_patient_falls_rate, digits =2)), nudge_y =-.25, color ="white")
+
+b1
+
+
+
+
+
+
+
+
+
Citation
BibTeX citation:
@online{belanger2020,
+ author = {Belanger, Kyle},
+ title = {My {Start} to {R}},
+ date = {2020-01-24},
+ langid = {en}
+}
+
For attribution, please cite this work as:
+Belanger, Kyle. 2020. “My Start to R.” January 24, 2020.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_site/posts/2020-01-04_my-start-to-r/my-start-to-r_files/figure-html/unnamed-chunk-5-1.png b/_site/posts/2020-01-04_my-start-to-r/my-start-to-r_files/figure-html/unnamed-chunk-5-1.png
new file mode 100644
index 0000000..e7dcf1d
Binary files /dev/null and b/_site/posts/2020-01-04_my-start-to-r/my-start-to-r_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/_site/search.json b/_site/search.json
index f7e31ff..81766a6 100644
--- a/_site/search.json
+++ b/_site/search.json
@@ -39,7 +39,7 @@
"href": "blog.html",
"title": "Posts",
"section": "",
- "text": "Post With Code\n\n\n\n\n\n\n\nnews\n\n\ncode\n\n\nanalysis\n\n\n\n\n\n\n\n\n\n\n\nOct 3, 2023\n\n\nHarlow Malloc\n\n\n\n\n\n\n \n\n\n\n\nWelcome To My Blog\n\n\n\n\n\n\n\nnews\n\n\n\n\n\n\n\n\n\n\n\nSep 30, 2023\n\n\nTristan O’Malley\n\n\n\n\n\n\nNo matching items"
+ "text": "My Start to R\n\n\nA short introduction to my blog, and R journey.\n\n\n\n\n\n\n\n\n\nJan 24, 2020\n\n\nKyle Belanger\n\n\n\n\n\n\nNo matching items"
},
{
"objectID": "posts/post-with-code/index.html",
@@ -47,5 +47,12 @@
"title": "Post With Code",
"section": "",
"text": "This is a post with executable code."
+ },
+ {
+ "objectID": "posts/2020-01-04_my-start-to-r/my-start-to-r.html",
+ "href": "posts/2020-01-04_my-start-to-r/my-start-to-r.html",
+ "title": "My Start to R",
+ "section": "",
+ "text": "Today starts my attempt at sharing my R journey with the world! I have been learning R off and on now since late 2019, I have begun to take it much more serious as I work through my Data Analytics class at UCF. My love for all things numbers and graphs has really blossomed, and I am choosing to share that love with anyone who cares to read. I will not claim to be the best at R, or any programming for that matter, but these are my attempts. Each post in this serious will be replicated a graph created in Tableau from the book Tableau for Healthcare. Todays graph is a simple horizontal bar chart, in transferring to both a new blog site and computer I have unfortunately lost the original bar graph, but trust me the one I created looks just like it.\n\nLoad Libraries\n\nlibrary(tidyr)\nlibrary(magrittr)\nlibrary(ggplot2)\nlibrary(stringr)\nlibrary(dplyr)\n\n\n\nImport Data\n\nds <- readxl::read_excel(\n path = \"Tableau 10 Training Practice Data.xlsx\" \n ,sheet = \"02 - Patient Falls-Single Hosp\"\n )\n\n\n\nClean Data Names\n\n#should make reusable forumla at later time\nnames(ds) <- tolower(names(ds))\nnames(ds) <- str_replace_all(names(ds),\" \", \"_\")\n\n\n\nConvert Data to ‘Long Form’\n\nds1 <- ds %>% \n gather(\"patient_falls_no_injury_rate\" , \"patient_falls_with_injury_rate\"\n ,key = \"injury\" \n ,value = \"rate\" ) %>% \n mutate(injury = (injury == \"patient_falls_with_injury_rate\"))\n\n\n\nGraph 5.1\n\nb1 <- ds %>% \n ggplot(mapping = aes(x = reorder(type_of_care,total_patient_falls_rate ) , y = total_patient_falls_rate)) +\n geom_col(fill = \"#2b83ba\") + \n coord_flip() +\n scale_y_continuous(breaks = NULL) +\n theme(axis.ticks = element_blank()) +\n labs(title = \"Rate of Patient Falls (per 1,000 Pateint Days)\\nby Type of Care for FY2017\"\n ,x = NULL\n ,y = NULL\n ) +\n theme_classic() +\n geom_text(aes(label = format(total_patient_falls_rate, digits = 2)), nudge_y = -.25, color = \"white\")\n \nb1\n\n\n\n\n\n\n\n\nCitationBibTeX citation:@online{belanger2020,\n author = {Belanger, Kyle},\n title = {My {Start} to {R}},\n date = {2020-01-24},\n langid = {en}\n}\nFor attribution, please cite this work as:\nBelanger, Kyle. 2020. “My Start to R.” January 24, 2020."
}
]
\ No newline at end of file
diff --git a/posts/2020-01-04_my-start-to-r/Tableau 10 Training Practice Data.xlsx b/posts/2020-01-04_my-start-to-r/Tableau 10 Training Practice Data.xlsx
new file mode 100644
index 0000000..b0e60c9
Binary files /dev/null and b/posts/2020-01-04_my-start-to-r/Tableau 10 Training Practice Data.xlsx differ
diff --git a/posts/2020-01-04_my-start-to-r/my-start-to-r.qmd b/posts/2020-01-04_my-start-to-r/my-start-to-r.qmd
new file mode 100644
index 0000000..ed1f13f
--- /dev/null
+++ b/posts/2020-01-04_my-start-to-r/my-start-to-r.qmd
@@ -0,0 +1,67 @@
+---
+title: "My Start to R"
+subtitle: |
+ A short introduction to my blog, and R journey.
+date: 01-24-2020
+
+---
+
+Today starts my attempt at sharing my R journey with the world! I have been learning R off and on now since late 2019, I have begun to take it much more serious as I work through my Data Analytics class at UCF. My love for all things numbers and graphs has really blossomed, and I am choosing to share that love with anyone who cares to read. I will not claim to be the best at R, or any programming for that matter, but these are my attempts. Each post in this serious will be replicated a graph created in Tableau from the book Tableau for Healthcare. Todays graph is a simple horizontal bar chart, in transferring to both a new blog site and computer I have unfortunately lost the original bar graph, but trust me the one I created looks just like it.
+
+# Load Libraries
+
+```{r}
+library(tidyr)
+library(magrittr)
+library(ggplot2)
+library(stringr)
+library(dplyr)
+```
+
+# Import Data
+
+```{r}
+ds <- readxl::read_excel(
+ path = "Tableau 10 Training Practice Data.xlsx"
+ ,sheet = "02 - Patient Falls-Single Hosp"
+ )
+```
+
+# Clean Data Names
+
+```{r}
+#should make reusable forumla at later time
+names(ds) <- tolower(names(ds))
+names(ds) <- str_replace_all(names(ds)," ", "_")
+
+```
+
+# Convert Data to 'Long Form'
+
+```{r}
+ds1 <- ds %>%
+ gather("patient_falls_no_injury_rate" , "patient_falls_with_injury_rate"
+ ,key = "injury"
+ ,value = "rate" ) %>%
+ mutate(injury = (injury == "patient_falls_with_injury_rate"))
+
+```
+
+# Graph 5.1
+
+```{r}
+b1 <- ds %>%
+ ggplot(mapping = aes(x = reorder(type_of_care,total_patient_falls_rate ) , y = total_patient_falls_rate)) +
+ geom_col(fill = "#2b83ba") +
+ coord_flip() +
+ scale_y_continuous(breaks = NULL) +
+ theme(axis.ticks = element_blank()) +
+ labs(title = "Rate of Patient Falls (per 1,000 Pateint Days)\nby Type of Care for FY2017"
+ ,x = NULL
+ ,y = NULL
+ ) +
+ theme_classic() +
+ geom_text(aes(label = format(total_patient_falls_rate, digits = 2)), nudge_y = -.25, color = "white")
+
+b1
+```
diff --git a/posts/_metadata.yml b/posts/_metadata.yml
index 6df598d..f6bcd44 100644
--- a/posts/_metadata.yml
+++ b/posts/_metadata.yml
@@ -2,7 +2,8 @@
# freeze computational output
# (see https://quarto.org/docs/projects/code-execution.html#freeze)
-freeze: true
+# may need to revist later
+# freeze: true
# Enable banner style title blocks
title-block-banner: true
@@ -17,4 +18,12 @@ author:
- name: Kyle Belanger
url: https://kyleb.rbind.io/
-citation: true
\ No newline at end of file
+citation: true
+
+execute:
+ echo: true
+ message: false
+ warning: false
+
+# this will enable blog wide code folding which I do not want at this time
+# code-fold: true
\ No newline at end of file