-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvi_combine.R
27 lines (18 loc) · 1.11 KB
/
vi_combine.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##Combine data outputs into one table for Catherine's uploads
Trends <- list.files(path = "C:/Users/dethier/Documents/ethier-scripts/RPI-Trends/Output/2023/", # Identify all CSV files
pattern = "*TrendsSlope.csv", full.names = TRUE) %>%
lapply(read_csv) %>% # Store all files in list
bind_rows # Combine data sets into one data set
#remove row with only NA
n<-nrow(Trends)
Trends<-Trends[2:n,]
Trends<-Trends %>% drop_na(results_code)
write.csv(Trends, "Output/2023/AllTrendsRPI.csv", row.names = FALSE)
Indices <- list.files(path = "C:/Users/dethier/Documents/ethier-scripts/RPI-Trends/Output/2023/", # Identify all CSV files
pattern = "*AnnualIndices.csv", full.names = TRUE) %>%
lapply(read_csv) %>% # Store all files in list
bind_rows # Combine data sets into one data set
m<-nrow(Indices)
Indices<-Indices[2:m,]
Indices<-Indices %>% drop_na(results_code)
write.csv(Indices, "Output/2023/AllIndicesRPI.csv", row.names = FALSE)