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 click http://rmarkdown.rstudio.com.

This is the R plotting of my 18 month progress a Capstone project I am creating for my Google Data Analytics cert. The data is all mine and I am including speaker notes that have links to my related research, as this is a filtered project.

first Updating and installing packages

update.packages(ask = "Yes")
## Warning: package 'cluster' in library '/opt/R/4.4.2/lib/R/library' will not be
## updated
## Warning: package 'survival' in library '/opt/R/4.4.2/lib/R/library' will not be
## updated
install.packages("tidyverse")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
install.packages("dplyr")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
install.packages("shiny")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
install.packages("rmarkdown")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
install.packages("ggplot2")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
install.packages("skimer")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)
## Warning: package 'skimer' is not available for this version of R
## 
## A version of this package for your version of R might be available elsewhere,
## see the ideas at
## https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
install.packages("janitor")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.4'
## (as 'lib' is unspecified)

second we must load the Libraries

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(shiny)
library(rmarkdown)
library(ggplot2)
library(skimr)
library(janitor)
## 
## Attaching package: 'janitor'
## 
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test

Third I will create data frames

gpa <- c(1.40, 2.70, 3.66, 3.67, 2.93, 2, 2.3)
term <- c("Spring 23", "Summer 23", "Fall 23", "Winter 24", "Spring 24", "Summer 24", "Fall 24")
housingstatus <- c("Floating", "Housed", "Housed", "Housed", "Homeless", "Homeless", "Housed")
weightLBS <- c(395, 362, 303, 278, 260, 283, 253)
medications <- c(1, 6, 4, 4, 4, 1, 2)
vitamins <- c(3, 5, 5, 5, 5, 3, 5)
usacbt <- c("none", "usacbt", "usacbt", "usacbt", "usacbt", "usacbt", "usacbt")
mastermonk <- c("mastermonk", "mastermonk", "mastermonk", "mastermonk", "mastermonk", "mastermonk", "mastermonk")
indiasadhguru <- c("none", "none", "none", "none", "indiasadhguru", "indiasadhguru", "indiasadhguru")

progress <- data.frame(term, gpa, housingstatus, weightLBS, medications, vitamins, usacbt, mastermonk, indiasadhguru)

head(progress)
##        term  gpa housingstatus weightLBS medications vitamins usacbt mastermonk
## 1 Spring 23 1.40      Floating       395           1        3   none mastermonk
## 2 Summer 23 2.70        Housed       362           6        5 usacbt mastermonk
## 3   Fall 23 3.66        Housed       303           4        5 usacbt mastermonk
## 4 Winter 24 3.67        Housed       278           4        5 usacbt mastermonk
## 5 Spring 24 2.93      Homeless       260           4        5 usacbt mastermonk
## 6 Summer 24 2.00      Homeless       283           1        3 usacbt mastermonk
##   indiasadhguru
## 1          none
## 2          none
## 3          none
## 4          none
## 5 indiasadhguru
## 6 indiasadhguru
str(progress)
## 'data.frame':    7 obs. of  9 variables:
##  $ term         : chr  "Spring 23" "Summer 23" "Fall 23" "Winter 24" ...
##  $ gpa          : num  1.4 2.7 3.66 3.67 2.93 2 2.3
##  $ housingstatus: chr  "Floating" "Housed" "Housed" "Housed" ...
##  $ weightLBS    : num  395 362 303 278 260 283 253
##  $ medications  : num  1 6 4 4 4 1 2
##  $ vitamins     : num  3 5 5 5 5 3 5
##  $ usacbt       : chr  "none" "usacbt" "usacbt" "usacbt" ...
##  $ mastermonk   : chr  "mastermonk" "mastermonk" "mastermonk" "mastermonk" ...
##  $ indiasadhguru: chr  "none" "none" "none" "none" ...
colnames(progress)
## [1] "term"          "gpa"           "housingstatus" "weightLBS"    
## [5] "medications"   "vitamins"      "usacbt"        "mastermonk"   
## [9] "indiasadhguru"

fourth I will create plots

the first will be point Chart

This chart follows my progress with the different levels of medications. I used the labs to place labels properly and I used ggplot to lay out the information.

ggplot(data = progress) + 
  geom_point(mapping = aes(x = gpa, y = term, color = medications)) + labs(title = "Poining to Progress", subtitle = "Created by: Cynthia Rattey", x = "GPA", y = "Quarter")

### data frame manipulation

progress$SpiritualPractices <- paste(progress$usacbt, progress$mastermonk, progress$indiasadhguru)

view(progress)

creating variables and a violin plot

ggplotGrades <- ggplot(progress) + 
              aes(x = gpa, color = SpiritualPractices) +
              geom_bar() + 
              labs(title = "Plot comparing grades and meditation",
                   subtitle = "Created by Cynthia Rattey",
                   x = "GPA",
                   Y = "Quarter") + facet_wrap(~ term)
ggplotGrades

lining progress

a quick note, my medication list will be available on the uploaded CSV’s and i will attach my data. terms: “usacbt” means USA location and corrective behavioral therapy Dr Jordan Peterson and Dr Andrew huberman, Master Monk is Shi Heng Yi indiasadhguru is a guru from india. All of these practices are based on meditative and introspecive practices

pointlineMeds <- ggplot(progress) + 
              aes(x = gpa, y = medications, 
                  color =   SpiritualPractices) +
              geom_point() +
              geom_line() +
              labs(title = "Plot comparing grades and  
                   medication",
                   subtitle = "Created by Cynthia Rattey",
                   x = "GPA",
                   Y = "medications")

 pointlineMeds             

### finally homelessness comparison to Grades

HousedLine <- pointlineMeds <- ggplot(progress) +                              aes(x = medications, y = term, 
                   color = housingstatus) +
               geom_point() +
               geom_line() +
               labs(title = "Point In Time with grades",
                    subtitle = "Created by Cynthia Rattey",
                    x = "medications", Y = "Quater")

HousedLine
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?

## Conclusiom

This project was created for Google Data analytics certificate. All the data I gathered was original and mine. I am including the folder of my work that includes the cleaned data (not altered data just extracted useful data)

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.