R and RSTUDIO Practice

Author

Ezra Yurman

Year two of the SSw doctoral program has begun. Pineapple. 2 to the 4th power is 16.

2^4
[1] 16

I can import now. :)

library(readxl)
read_xlsx("STEM_occupations.xlsx")
New names:
• `` -> `...2`
• `` -> `...3`
• `` -> `...4`
• `` -> `...5`
• `` -> `...6`
• `` -> `...7`
• `` -> `...8`
• `` -> `...9`
• `` -> `...10`
• `` -> `...11`
• `` -> `...12`
• `` -> `...13`
• `` -> `...14`
• `` -> `...15`
• `` -> `...16`
• `` -> `...17`
# A tibble: 156 × 17
   Table with row header…¹ ...2  ...3  ...4  ...5  ...6  ...7  ...8  ...9  ...10
   <chr>                   <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
 1 Table 1. STEM and STEM… <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA> 
 2 Civilian employed aged… <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA> 
 3 <NA>                    <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA> 
 4 <NA>                    Civi… <NA>  <NA>  <NA>  <NA>  <NA>  Perc… <NA>  Full…
 5 Occupational Category   Esti… <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  <NA>  Medi…
 6 <NA>                    Total <NA>  Men   <NA>  Women <NA>  <NA>  <NA>  Total
 7 <NA>                    Esti… MOE3  Esti… MOE3  Esti… MOE3  Esti… MOE3  Esti…
 8 Total Employed          1587… 1584… 8306… 91586 7569… 1060… 47.7  0.1   50078
 9 .Total STEM2 Occupatio… 1076… 73112 7890… 57816 2879… 28856 26.7  0.2   87170
10 ..Computer Occupations: 5509… 42270 4093… 33864 1416… 21013 25.7  0.3   91010
# ℹ 146 more rows
# ℹ abbreviated name:
#   ¹​`Table with row headers in column A, and column headers in rows 5 through 544. Leading dots indicate subparts.`
# ℹ 7 more variables: ...11 <chr>, ...12 <chr>, ...13 <chr>, ...14 <chr>,
#   ...15 <chr>, ...16 <chr>, ...17 <chr>
stem_occupations <- read_xlsx("STEM_occupations.xlsx")
New names:
• `` -> `...2`
• `` -> `...3`
• `` -> `...4`
• `` -> `...5`
• `` -> `...6`
• `` -> `...7`
• `` -> `...8`
• `` -> `...9`
• `` -> `...10`
• `` -> `...11`
• `` -> `...12`
• `` -> `...13`
• `` -> `...14`
• `` -> `...15`
• `` -> `...16`
• `` -> `...17`
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.3     ✔ 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
ncbirths <- read.csv("https://bit.ly/ncbirths")
ggplot(
  data = ncbirths,
  mapping = aes(x=weeks, y=weight)
)  +
    geom_point()
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).