Publications by Leo Tzang

HW5重做

08.01.2024

library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(tidyr) library(readr) unique_categories <- read_csv("bike folder/bike_orderlines.csv") ## Rows: 15644 Column...

24 sym R (2995 sym/21 pcs)

HW4 重做

08.01.2024

reshape it from wide to long format (stock_df_long) library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.4.4 ✔ tibble 3.2....

61 sym R (1592 sym/6 pcs)

Hw3 重做

08.01.2024

Which product categories have the most sales? Use ‘bike_orderline_tbl’. Group and summarize the data calling the new column as ‘Sales’. Format the sales as ‘dollars()’. Rename ‘category_1’ to ‘Prime category’, ‘category_2’ to ‘Secondary category’, ‘frame_material’ to ‘Frame Material’. library(dplyr) ## ## Atta...

302 sym R (1878 sym/9 pcs)

HW2 重做 NETFLIX

08.01.2024

You want to learn which six actors have the most appearances in TV show. The multiple actors are listed in the cast column. Transform the data so that for each TV show, every actor has a row. Rename the column name “cast” to “actor”. library(tidyr) library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'pa...

243 sym R (902 sym/6 pcs)

DocumentFinalExam

02.01.2024

install.packages("nycflights13") ## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3' ## (as 'lib' is unspecified) library(nycflights13) data(flights) # Question 1: How many flights arrived late each month? late_arrivals <- flights[flights$arr_delay > 5, ] late_arrivals_by_month <- table(format(late_arrivals$time_hour, "%Y-%m")...

26 sym R (8255 sym/22 pcs) 1 img

Publish DocumentFinalExamm

02.01.2024

install.packages("nycflights13") ## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3' ## (as 'lib' is unspecified) library(nycflights13) data(flights) # Question 1: How many flights arrived late each month? late_arrivals <- flights[flights$arr_delay > 5, ] late_arrivals_by_month <- table(format(late_arrivals$time_hour, "%Y-%m")...

24 sym R (9811 sym/20 pcs) 1 img

Final_Exam_Munkhzul_112035134

02.01.2024

# Load libraries library(tidyverse) ## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.4 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ t...

25 sym R (9346 sym/20 pcs) 2 img

hw1 重新做

31.12.2023

Load up required libraries: tidyverse, lubridate, tidyquant, readxl, writexl. Import the data files using read_excel() to import excel files. Based on bikes.xlsx, show “model” and “price” column with “price” in descending order. (Hint: use select(), arrange(), desc()) Based on bikes.xlsx, show “model” and “price” column with “...

424 sym R (1889 sym/6 pcs)

Exercise_3_munkhzul

19.12.2023

#question_1 library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union responses <- read.csv("/cloud/project/multipleChoiceResponses.csv", header = TRUE, stringsAsFactors = FA...

27 sym R (8572 sym/19 pcs) 5 img

Documentshur

28.11.2023

# Install the readxl package (if not already installed) # install.packages("readxl") # Load necessary libraries library(readxl) library(dplyr) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, set...

9 sym R (1516 sym/6 pcs)