This workflow prepares an export of the data modified for display on the FCRWQDC Data Visualization Tool.
Code
library(here)
library(magrittr)
library(dplyr)
df <- readr::read_delim(
here("data/Discrete WQ - 10006.txt"),
delim = "|"
)
# keep only columns of interest
cols_of_interest <- c(
"ProgramName",
"ProgramLocationID",
"OriginalLatitude", "OriginalLongitude",
"ActivityDepth_m",
"ParameterUnits",
"ResultValue",
"SampleDate"
)
df <- df %>% select(all_of(cols_of_interest))
# create data/exports if DNE
dir.create(here::here("data", "exports"), showWarnings = FALSE)
# save to csv
write.csv(df, here::here("data", "exports", "dashboardDataSEACAR.csv"), row.names = FALSE)