lab 1.2

pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

20

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

9

Uploaded by SargentSteel13245

Report
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 1/9 ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ✔ dplyr 1.1.3 ✔ readr 2.1.4 ✔ forcats 1.0.0 ✔ stringr 1.5.0 ✔ ggplot2 3.4.4 ✔ tibble 3.2.1 ✔ lubridate 1.9.3 ✔ tidyr 1.3.0 ✔ 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 `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. library (stat20data) library (tidyverse) data (class_survey) ggplot ( data= class_survey, mapping = aes ( x = coding_exp_scale)) + geom_histogram ()
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 2/9 # A tibble: 619 × 1 coding_exp_scale <dbl> 1 1 2 1 3 7 4 6 5 2 6 5 7 4 8 8 9 1 10 5 # 609 more rows library (tidyverse) library (dplyr) coding_experience <- select (class_survey, coding_exp_scale) coding_experience
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 3/9 # A tibble: 1 × 2 coding_experience_IQR coding_experience_median <dbl> <dbl> 1 4 2 `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. summarise (coding_experience, coding_experience_IQR = IQR (coding_exp_scale), coding_experience_median = median (coding_exp_scale)) library (stat20data) library (tidyverse) library (ggplot2) data (class_survey) filtered_survey <- filter (class_survey, new_COVID_variant >= 0 , new_COVID_variant < 1 ) ggplot ( data = filtered_survey, mapping = aes ( x= new_COVID_variant)) + geom_histogram ()
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 4/9 # A tibble: 1 × 1 filtered_survey_sd <dbl> 1 0.222 library (stat20data) data (class_survey) filtered_survey <- filter (class_survey, new_COVID_variant >= 0 , new_COVID_variant < 1 ) summarise (filtered_survey, filtered_survey_sd = sd (new_COVID_variant)) library (stat20data) data (class_survey) filtered_survey <- filter (class_survey, new_COVID_variant >= 0 ,
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 5/9 # A tibble: 1 × 1 filtered_survey_mean <dbl> 1 0.311 new_COVID_variant < 1 ) summarise (filtered_survey, filtered_survey_mean = mean (new_COVID_variant)) library (tidyverse) library (stat20data) data (class_survey) ggplot (class_survey, aes ( x = factor (season, levels = c ( "Spring" , "Summer" , "Fall" , "Winter" )), fill = beach_or_mtns)) + geom_bar ( position = "fill" )
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 6/9 ggplot ( data = class_survey, mapping = aes ( x = crypto, y = entrepreneur)) + geom_boxplot ()
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 7/9 # A tibble: 2 × 3 entrepreneur cryptocurrency_SD cryptocurrency_mean <lgl> <dbl> <dbl> 1 FALSE 2.23 5.03 2 TRUE 2.26 5.57 group_by (class_survey, entrepreneur) |> summarise ( cryptocurrency_SD = sd (crypto), cryptocurrency_mean = mean (crypto))
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 8/9 # A tibble: 7 × 2 title coding_exp_median <chr> <dbl> 1 Artist 1 2 Computational Scientist 7 3 Entrepreneur 2 4 Humanist 1 5 Natural Scientist 2 ggplot ( data = class_survey, mapping = aes ( x= climate_change, fill= natural_scientist)) + geom_bar ( position= "fill" ) group_by (class_survey, title) |> summarise ( coding_exp_median = median (coding_exp_scale))
1/30/24, 1:09 AM lab 1.2 https://stat20.datahub.berkeley.edu/user/aisharakyan/rstudio/p/2f2e0a1b/ 9/9 6 Other 2 7 Social Scientist 1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help