Skip to content

Commit 35f6e17

Browse files
committed
some adjustments and typos in how-to vignette
1 parent e78cc0a commit 35f6e17

10 files changed

+38
-28
lines changed

vignettes/howto.Rmd

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ One can create a true colour image map from optical model output of the Great Ba
3030
map_ereefs(target_date = c(2019, 2, 28))
3131
```
3232

33-
<img src="vignette-fig-exmp1-1.png" alt="plot of chunk exmp1" width="60%" style="display: block; margin: auto;" />
33+
<img src="vignette-fig-exmp1-1.png" alt="plot of chunk exmp1" width="80%" style="display: block; margin: auto;" />
3434

3535
It is also possible to map optical colour classes (note the default colour scheme is not great for this, so one might want to add a different colour scale after producing the figure handle):
3636

@@ -39,7 +39,7 @@ It is also possible to map optical colour classes (note the default colour schem
3939
map_ereefs(var_name = "plume", target_date = c(2019, 2, 28))
4040
```
4141

42-
<img src="vignette-fig-exmp2-1.png" alt="plot of chunk exmp2" width="60%" style="display: block; margin: auto;" />
42+
<img src="vignette-fig-exmp2-1.png" alt="plot of chunk exmp2" width="80%" style="display: block; margin: auto;" />
4343

4444
We can also map, for example, the extent of the influence of the Burdekin River (choose menu option 8 or 7):
4545

@@ -51,11 +51,19 @@ map_ereefs(
5151
)
5252
```
5353

54-
<img src="vignette-fig-exmp3-1.png" alt="plot of chunk exmp3" width="60%" style="display: block; margin: auto;" />
54+
<img src="vignette-fig-exmp3-1.png" alt="plot of chunk exmp3" width="80%" style="display: block; margin: auto;" />
5555

5656
The colour scale can be customised. For example, the code below changes the limits of the colour scale so that the max colour intensity is achieved when 1% of water is river water, and change the colours:
5757

58-
<img src="vignette-fig-exmp4-1.png" alt="plot of chunk exmp4" width="60%" style="display: block; margin: auto;" />
58+
59+
```r
60+
map_ereefs(
61+
var_name = "bur", target_date = c(2022, 2, 28), scale_lim = c(0, 0.01),
62+
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr1_2.0_rivers/gbr1_rivers_simple_2022-08-28.nc.html"
63+
)
64+
```
65+
66+
<img src="vignette-fig-exmp4-1.png" alt="plot of chunk exmp4" width="80%" style="display: block; margin: auto;" />
5967

6068
We can also plot different variables such as chlorophyll-a at a particular depth (e.g., 5 m below MSL; default is at the surface), add a land map to the plot, and focus on a particular region (choose menu option 9 for higher resolution):
6169

@@ -67,14 +75,15 @@ map_ereefs(
6775
)
6876
```
6977

70-
<img src="vignette-fig-exmp5-1.png" alt="plot of chunk exmp5" width="60%" style="display: block; margin: auto;" />
78+
<img src="vignette-fig-exmp5-1.png" alt="plot of chunk exmp5" width="80%" style="display: block; margin: auto;" />
7179

7280
## Images for animations
7381

74-
We can also create the image files needed for a true colour animation of surface salinity in this area (then use [`gifski`](https://cran.r-project.org/web/packages/gifski/index.html) or similar to generate the animation). Below, `salt_list` is a list that includes the plot handle as well as the temporal mean salinity for each point in the map over the period of the animation, plus the cell centre geo-locations (choose menu option 9). By default, images are saved to the directory `"ToAnimate"`, but can be changed via the argument `output_dir`:
82+
We can also create the image files needed for a true colour animation of surface salinity in this area (then use [`gifski`](https://cran.r-project.org/web/packages/gifski/index.html) or similar to generate the animation). Below, `salt_list` is a list that includes the plot handle as well as the temporal mean salinity for each point in the map over the period of the animation, plus the cell centre geo-locations (choose menu option 9). By default, images are saved to the directory `"ToAnimate"`, but can be changed via the argument `output_dir` (**NB: the code below is not run**):
7583

7684

7785
```r
86+
# code not run
7887
map_ereefs_movie(
7988
var_name = "salt", start_date = c(2019, 2, 15), end_date = c(2019, 3, 10),
8089
Land_map = TRUE, box_bounds = c(145, 150, -22, -18), scale_col = "spectral",
@@ -95,9 +104,6 @@ temp_slice <- get_ereefs_slice(
95104
```
96105

97106

98-
```
99-
#> [1] "transect section 1 of 1"
100-
```
101107

102108
Now visualise the results:
103109

@@ -106,9 +112,9 @@ Now visualise the results:
106112
plot_ereefs_slice(temp_slice, var_name = "temp", scale_col = "spectral")
107113
```
108114

109-
<img src="vignette-fig-exmp8-1.png" alt="plot of chunk exmp8" width="60%" style="display: block; margin: auto;" /><img src="vignette-fig-exmp8-2.png" alt="plot of chunk exmp8" width="60%" style="display: block; margin: auto;" />
115+
<img src="vignette-fig-exmp8-1.png" alt="plot of chunk exmp8" width="80%" style="display: block; margin: auto;" />
110116

111-
We can also extract a vertical profile (rather than a slice) of, for example, chlorophyll-a and nitrate at a single location and time (choose menu options 11):
117+
We can also extract a vertical profile (rather than a slice) of, for example, chlorophyll-a and nitrate at a single location and time (choose menu option 11):
112118

113119

114120
```r
@@ -119,9 +125,6 @@ profile_data <- get_ereefs_profile(
119125
```
120126

121127

122-
```
123-
#> | | | 0% | |==================================================================================================================================================================================| 100%
124-
```
125128

126129
Now visualise the results for NO~3^-^~:
127130

@@ -132,7 +135,7 @@ plot_ereefs_profile(
132135
)
133136
```
134137

135-
<img src="vignette-fig-exmp10-1.png" alt="plot of chunk exmp10" width="60%" style="display: block; margin: auto;" />
138+
<img src="vignette-fig-exmp10-1.png" alt="plot of chunk exmp10" width="80%" style="display: block; margin: auto;" />
136139

137140
We are currently working on improving the function `get_ereefs_profile` so that it can work for multiple time profiles.
138141

vignettes/howto.Rmd.orig

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ knitr::opts_chunk$set(
1616
warning = FALSE,
1717
message = FALSE,
1818
fig.path = "vignette-fig-",
19-
fig.asp = 0.8,
20-
out.width = "60%",
19+
out.width = "80%",
2120
fig.align = "center",
2221
dpi = 120,
2322
eval = identical(Sys.getenv("NOT_CRAN"), "true")
@@ -42,7 +41,7 @@ One can create a true colour image map from optical model output of the Great Ba
4241
map_ereefs(target_date = c(2019, 2, 28))
4342
```
4443

45-
```{r exmp1, echo = FALSE, fig.width = 11}
44+
```{r exmp1, echo = FALSE, fig.width = 6.38, fig.height = 9}
4645
map_ereefs(
4746
target_date = c(2019, 2, 28),
4847
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_bgc_GBR4_H2p0_B3p1_Cq3b_Dhnd/gbr4_bgc_all_simple_2019-02.nc.html"
@@ -55,7 +54,7 @@ It is also possible to map optical colour classes (note the default colour schem
5554
map_ereefs(var_name = "plume", target_date = c(2019, 2, 28))
5655
```
5756

58-
```{r exmp2, echo = FALSE, fig.width = 11}
57+
```{r exmp2, echo = FALSE, fig.width = 6.38, fig.height = 9}
5958
map_ereefs(
6059
var_name = "plume", target_date = c(2019, 2, 28),
6160
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_bgc_GBR4_H2p0_B3p1_Cq3b_Dhnd/gbr4_bgc_all_simple_2019-02.nc.html"
@@ -71,7 +70,7 @@ map_ereefs(
7170
)
7271
```
7372

74-
```{r exmp3, echo = FALSE, fig.width = 11}
73+
```{r exmp3, echo = FALSE, fig.width = 6.38, fig.height = 9}
7574
map_ereefs(
7675
var_name = "bur", target_date = c(2022, 2, 28),
7776
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr1_2.0_rivers/gbr1_rivers_simple_2022-02-28.nc.html"
@@ -80,7 +79,14 @@ map_ereefs(
8079

8180
The colour scale can be customised. For example, the code below changes the limits of the colour scale so that the max colour intensity is achieved when 1% of water is river water, and change the colours:
8281

83-
```{r exmp4, echo = FALSE, fig.width = 11}
82+
```{r exmp4-f, eval = FALSE}
83+
map_ereefs(
84+
var_name = "bur", target_date = c(2022, 2, 28), scale_lim = c(0, 0.01),
85+
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr1_2.0_rivers/gbr1_rivers_simple_2022-08-28.nc.html"
86+
)
87+
```
88+
89+
```{r exmp4, echo = FALSE, fig.width = 6.38, fig.height = 9}
8490
map_ereefs(
8591
var_name = "bur", target_date = c(2022, 2, 28), scale_lim = c(0, 0.01),
8692
input_file = "https://dapds00.nci.org.au/thredds/dodsC/fx3/gbr1_2.0_rivers/gbr1_rivers_simple_2022-08-28.nc.html"
@@ -96,7 +102,7 @@ map_ereefs(
96102
)
97103
```
98104

99-
```{r exmp5, echo = FALSE, fig.width = 11}
105+
```{r exmp5, echo = FALSE, fig.width = 6.9, fig.height = 5.8}
100106
map_ereefs(
101107
var_name = "Chl_a_sum", target_date = c(2019, 2, 28),
102108
scale_col = "spectral", Land_map = TRUE, box_bounds = c(145, 150, -22, -18),
@@ -106,9 +112,10 @@ map_ereefs(
106112

107113
## Images for animations
108114

109-
We can also create the image files needed for a true colour animation of surface salinity in this area (then use [`gifski`](https://cran.r-project.org/web/packages/gifski/index.html) or similar to generate the animation). Below, `salt_list` is a list that includes the plot handle as well as the temporal mean salinity for each point in the map over the period of the animation, plus the cell centre geo-locations (choose menu option 9). By default, images are saved to the directory `"ToAnimate"`, but can be changed via the argument `output_dir`:
115+
We can also create the image files needed for a true colour animation of surface salinity in this area (then use [`gifski`](https://cran.r-project.org/web/packages/gifski/index.html) or similar to generate the animation). Below, `salt_list` is a list that includes the plot handle as well as the temporal mean salinity for each point in the map over the period of the animation, plus the cell centre geo-locations (choose menu option 9). By default, images are saved to the directory `"ToAnimate"`, but can be changed via the argument `output_dir` (**NB: the code below is not run**):
110116

111117
```{r exmp6-f, eval = FALSE}
118+
# code not run
112119
map_ereefs_movie(
113120
var_name = "salt", start_date = c(2019, 2, 15), end_date = c(2019, 3, 10),
114121
Land_map = TRUE, box_bounds = c(145, 150, -22, -18), scale_col = "spectral",
@@ -127,7 +134,7 @@ temp_slice <- get_ereefs_slice(
127134
)
128135
```
129136

130-
```{r exmp7, echo = FALSE}
137+
```{r exmp7, echo = FALSE, results = "hide"}
131138
temp_slice <- get_ereefs_slice(
132139
var_names = "temp", target_date = c(2022, 8, 1),
133140
location_latlon = data.frame(latitude = c(-20, -20), longitude = c(145, 150)),
@@ -137,11 +144,11 @@ temp_slice <- get_ereefs_slice(
137144

138145
Now visualise the results:
139146

140-
```{r exmp8, fig.width = 11}
147+
```{r exmp8, fig.width = 6, fig.height = 4.8}
141148
plot_ereefs_slice(temp_slice, var_name = "temp", scale_col = "spectral")
142149
```
143150

144-
We can also extract a vertical profile (rather than a slice) of, for example, chlorophyll-a and nitrate at a single location and time (choose menu options 11):
151+
We can also extract a vertical profile (rather than a slice) of, for example, chlorophyll-a and nitrate at a single location and time (choose menu option 11):
145152

146153
```{r exmp9-f, eval = FALSE}
147154
profile_data <- get_ereefs_profile(
@@ -150,7 +157,7 @@ profile_data <- get_ereefs_profile(
150157
)
151158
```
152159

153-
```{r exmp9, echo = FALSE}
160+
```{r exmp9, echo = FALSE, results = "hide"}
154161
profile_data <- get_ereefs_profile(
155162
var_names = c("Chl_a_sum", "NO3"), start_date = c(2019, 3, 10),
156163
end_date = c(2019, 3, 10), location_latlon = c(-23.39, 150.89),
@@ -160,7 +167,7 @@ profile_data <- get_ereefs_profile(
160167

161168
Now visualise the results for NO~3^-^~:
162169

163-
```{r exmp10, fig.width = 11}
170+
```{r exmp10, fig.width = 6, fig.height = 4.8}
164171
plot_ereefs_profile(
165172
profile_data, var_name = "NO3", target_date = c(2019, 3, 10)
166173
)

vignettes/vignette-fig-exmp1-1.png

-12.8 KB
Loading
-30.5 KB
Loading

vignettes/vignette-fig-exmp2-1.png

-41.2 KB
Loading

vignettes/vignette-fig-exmp3-1.png

-10.8 KB
Loading

vignettes/vignette-fig-exmp4-1.png

-16 KB
Loading

vignettes/vignette-fig-exmp5-1.png

-691 KB
Loading

vignettes/vignette-fig-exmp8-1.png

-19.9 KB
Loading

vignettes/vignette-fig-exmp8-2.png

-50.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)