Skip to content

Commit 6e6f8b3

Browse files
committed
markdown source builds
Auto-generated via {sandpaper} Source : 893926e Branch : main Author : Drake Asberry <47766074+drakeasberry@users.noreply.github.com> Time : 2024-06-15 20:58:18 +0000 Message : Merge pull request #439 from sstevens2/count-fix Rm group by func call
1 parent 631b2e7 commit 6e6f8b3

File tree

2 files changed

+10
-30
lines changed

2 files changed

+10
-30
lines changed

02-raster-plot.md

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ source: Rmd
66
---
77

88

9-
``` warning
10-
Warning in
11-
download.file("https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_graticules_all.zip",
12-
: cannot open URL
13-
'https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_graticules_all.zip':
14-
HTTP status was '500 Internal Server Error'
15-
```
16-
17-
``` error
18-
Error in download.file("https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_graticules_all.zip", : cannot open URL 'https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_graticules_all.zip'
19-
```
209

2110
::::::::::::::::::::::::::::::::::::::: objectives
2211

@@ -90,24 +79,19 @@ unique(DSM_HARV_df$fct_elevation)
9079
Levels: (305,342] (342,379] (379,416]
9180
```
9281

93-
And we can get the count of values in each group using `dplyr`'s `group_by()`
94-
and `count()` functions:
82+
And we can get the count of values in each group using `dplyr`'s `count()` function:
9583

9684

9785
``` r
9886
DSM_HARV_df %>%
99-
group_by(fct_elevation) %>%
100-
count()
87+
count(fct_elevation)
10188
```
10289

10390
``` output
104-
# A tibble: 3 × 2
105-
# Groups: fct_elevation [3]
10691
fct_elevation n
107-
<fct> <int>
108-
1 (305,342] 418891
109-
2 (342,379] 1530073
110-
3 (379,416] 370835
92+
1 (305,342] 418891
93+
2 (342,379] 1530073
94+
3 (379,416] 370835
11195
```
11296

11397
We might prefer to customize the cutoff values for these groups.
@@ -159,18 +143,14 @@ And we can get the count of values in each group in the same way we did before:
159143

160144
``` r
161145
DSM_HARV_df %>%
162-
group_by(fct_elevation_2) %>%
163-
count()
146+
count(fct_elevation_2)
164147
```
165148

166149
``` output
167-
# A tibble: 3 × 2
168-
# Groups: fct_elevation_2 [3]
169150
fct_elevation_2 n
170-
<fct> <int>
171-
1 (300,350] 741815
172-
2 (350,400] 1567316
173-
3 (400,450] 10668
151+
1 (300,350] 741815
152+
2 (350,400] 1567316
153+
3 (400,450] 10668
174154
```
175155

176156
We can use those groups to plot our raster data, with each group being a

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"config.yaml" "8f4c7a49b9d32beef686bcd8ae3e4c5f" "site/built/config.yaml" "2024-06-04"
66
"index.md" "8704017272467874007912c316744a00" "site/built/index.md" "2024-06-04"
77
"episodes/01-raster-structure.Rmd" "93bf05e4999d6545ba0f3f1ba1aafdaa" "site/built/01-raster-structure.md" "2024-06-15"
8-
"episodes/02-raster-plot.Rmd" "3bc30659ae4d91c31a1175ff7127531a" "site/built/02-raster-plot.md" "2024-06-04"
8+
"episodes/02-raster-plot.Rmd" "5de487340aa50257089b12295059018b" "site/built/02-raster-plot.md" "2024-06-15"
99
"episodes/03-raster-reproject-in-r.Rmd" "d11ff839db427f11b0f0d5e8f7825c80" "site/built/03-raster-reproject-in-r.md" "2024-06-04"
1010
"episodes/04-raster-calculations-in-r.Rmd" "a100233c7c80bcae34c0112d10980d0d" "site/built/04-raster-calculations-in-r.md" "2024-06-04"
1111
"episodes/05-raster-multi-band-in-r.Rmd" "cc2d67a1e5356d3684289205221a8233" "site/built/05-raster-multi-band-in-r.md" "2024-06-04"

0 commit comments

Comments
 (0)