forked from LimnoDataScience/get_NLDAS2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
04_reformat.R
18 lines (16 loc) · 1.08 KB
/
04_reformat.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
library(tidyverse)
drivers_reformat <- drivers_CT %>%
mutate(Precipitation_millimeterPerDay = Rain.m_day * 1000) %>%
select(-SpecHumidity.kg_kg) %>%
rename(datetime = dateTime,
Air_Temperature_celsius = AirTemp.C,
Shortwave_Radiation_Downwelling_wattPerMeterSquared = ShortWave.W_m2,
Longwave_Radiation_Downwelling_wattPerMeterSquared = LongWave.W_m2,
Relative_Humidity_percent = RelHum,
Ten_Meter_Elevation_Wind_Speed_meterPerSecond = WindSpeed.m_s,
Surface_Level_Barometric_Pressure_pascal = SurfPressure.Pa)
col_order <- c("datetime", "Air_Temperature_celsius", "Shortwave_Radiation_Downwelling_wattPerMeterSquared",
"Longwave_Radiation_Downwelling_wattPerMeterSquared", "Relative_Humidity_percent",
"Ten_Meter_Elevation_Wind_Speed_meterPerSecond", "Precipitation_millimeterPerDay", "Surface_Level_Barometric_Pressure_pascal")
drivers_reformat <- drivers_reformat[, col_order]
write.csv(drivers_reformat,paste0(LakeName,'_Final/',LakeName,'_all_variables_for_1DAEMpy.csv'),row.names = F, quote = F)