R Markdown
# Install and load necessary packages
if (!require("pacman")) install.packages("pacman")
## Loading required package: pacman
pacman::p_load(readr, tidyverse)
# --- TASK 1: Import TEJ Quarterly Financial Data ---
# A window will pop up. Please select your downloaded CSV file.
financial_data <- read_csv(file.choose())
## Rows: 132492 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): COID, COID_Name, YYYY/MM
## dbl (1): Quarter
## num (3): Net operating income (loss), Total equity, Market Value of Common S...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# --- TASK 2: Clean and format the dataset ---
# Rename columns to shorter, standard English names based on column positions
financial_clean <- financial_data %>%
rename(
Stock_ID = 1,
Company_Name = 2,
Year_Month = 3,
Quarter = 4,
Operating_Income = 5,
Total_Equity = 6,
Market_Value = 7
)
# Show the first few rows of the formatted dataset
print("Taiwan Listed Firms - Quarterly Financial Data (2010 - 2026)")
## [1] "Taiwan Listed Firms - Quarterly Financial Data (2010 - 2026)"
head(financial_clean)
## # A tibble: 6 × 7
## Stock_ID Company_Name Year_Month Quarter Operating_Income Total_Equity
## <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 1470 Evertex 2026/03 1 23476 984715
## 2 1470 Evertex 2025/12 4 38101 1013489
## 3 1470 Evertex 2025/09 3 5879 974948
## 4 1470 Evertex 2025/06 2 23369 953907
## 5 1470 Evertex 2025/03 1 16173 967802
## 6 1470 Evertex 2024/12 4 25355 1034946
## # ℹ 1 more variable: Market_Value <dbl>