Files
powershell_example/scripts/08_format.R

18 lines
393 B
R

# 07_format.R
# Reads final result, rounds all numeric columns to 2 decimal places.
source("scripts/00_paths.R")
library(readr)
library(dplyr)
df <- read_csv(result, show_col_types = FALSE)
df_formatted <- df |>
mutate(across(where(is.numeric), ~ round(.x, 2)))
write_csv(df_formatted, formatted)
cat("07_format.R: rounded to 2 decimals, wrote df_formatted.csv\n")
print(df_formatted)