Skip to content

Commit

Permalink
simplify data.frame creation in Example_Use.R
Browse files Browse the repository at this point in the history
  • Loading branch information
CeresBarros committed Dec 21, 2023
1 parent 8e27b2e commit 21023ff
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Example_Use.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ historic <- historic_input(dbCon, thebb, period = "2001_2020")
plot(historic[[1]][[2]])

##provide or create a long, lat, elev, and optionally id, dataframe - usually read from csv file
in_xyz <- structure(list(Long = c(-127.70521, -127.62279, -127.56235, -127.7162,
## smaller example in BC
-127.18585, -127.1254, -126.94957, -126.95507),
Lat = c(55.3557, 55.38847, 55.28537, 55.25721, 54.88135, 54.65636, 54.6913, 54.61025),
Elev = c(291L, 296L, 626L, 377L, 424L, 591L, 723L, 633L),
ID = LETTERS[1:8],
Zone = c(rep("CWH",3), rep("CDF",5)),
Subzone = c("vm1","vm2","vs1",rep("mm",3),"dk","dc")),
row.names = c(NA, -8L), class = "data.frame")
in_xyz <- data.frame(Long = c(-127.70521, -127.62279, -127.56235, -127.7162,
-127.18585, -127.1254, -126.94957, -126.95507),
Lat = c(55.3557, 55.38847, 55.28537, 55.25721, 54.88135, 54.65636, 54.6913, 54.61025),
Elev = c(291L, 296L, 626L, 377L, 424L, 591L, 723L, 633L),
Zone = c(rep("CWH",3), rep("CDF",5)),
Subzone = c("vm1","vm2","vs1",rep("mm",3),"dk","dc")),

##show available variables:
list_variables()
Expand Down Expand Up @@ -69,7 +66,7 @@ ggplot(res2[RUN != "ensembleMean",],aes(x = PERIOD, y = Tave01, col = RUN, group

##historic timeseries
ds_results_hist <- climr_downscale(xyz = in_xyz, which_normal = "auto",
gcm_models = c("ACCESS-ESM1-5"),
gcm_models = c("ACCESS-ESM1-5"),
gcm_hist_years = 1910:2010,
historic_ts = 1910:2010,
return_normal = FALSE,
Expand Down

0 comments on commit 21023ff

Please sign in to comment.