You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/articles/1.3-ViewData.Rmd
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ All contributing members of NatureCounts have complete authority over the use of
49
49
You can view the Data Access Level for each collection on the [NatureCounts Datasets](https://naturecounts.ca/nc/default/datasets.jsp) page or using the [metadata](#Data3.5) function (see `akn_level`):
50
50
51
51
```{r access, eval = FALSE}
52
-
collections<-meta_collections()
52
+
collections <- meta_collections()
53
53
View(collections)
54
54
```
55
55
@@ -133,8 +133,8 @@ There are [metadata](https://birdstudiescanada.github.io/naturecounts/reference/
133
133
Any of these functions can be used to browse the code lists relevant to your search. For example, you can view the metadata for Birds Canada projects, including project ids using:
134
134
135
135
```{r meta, eval = FALSE}
136
-
project_ids <- meta_projects() # retrieve the project_ids represented in the repository
137
-
View(project_ids) # explore the dataframe
136
+
project_ids <- meta_projects() # retrieve the project_ids represented in the repository
137
+
View(project_ids) # explore the dataframe
138
138
```
139
139
140
140
Using the above functions to search by country, state/province, subnational2, BCR etc. is especially useful for regional filtering in this next section.
@@ -176,7 +176,7 @@ When using the `nc_count()` view function, you have the helpful option of filter
176
176
First, let's limit our data search to Quebec:
177
177
178
178
```{r nc_count example, eval=FALSE}
179
-
nc_count(region = list(statprov="QC")) # filter nc_count by statprov
179
+
nc_count(region = list(statprov = "QC")) # filter nc_count by statprov
180
180
```
181
181
182
182
Next, let's say we want to narrow down our search to the subnational level (Montreal and Toronto) but don't know the corresponding codes for these regions.
@@ -191,19 +191,21 @@ Or, more efficiently, search by region:
191
191
192
192
```{r}
193
193
search_region("Montreal", type = "subnational2")
194
+
search_region("Toronto", type = "subnational2")
194
195
```
195
196
196
197
Great, we now know the codes we need and can view our metadata using `nc_count()`:
region = list(bbox = c(left = -125, bottom = 45, right = -100, top = 50))
208
+
)
207
209
```
208
210
209
211
Another commonly used filter is specific to `species`. In order to filter by `species` you need to get the species id codes. These are numeric codes that reflect species identity.
@@ -285,7 +287,7 @@ The following code will retrieve all available collections and number of records
285
287
search_species("Red-headed Woodpecker")
286
288
search_species_code("RHWO")
287
289
288
-
RHWO<-nc_count(species = 10060)
290
+
RHWO <- nc_count(species = 10060)
289
291
View(RHWO)
290
292
```
291
293
@@ -298,7 +300,11 @@ View(RHWO_11)
298
300
RHWO_year <- nc_count(species = 10060, year = c(2015, 2019))
299
301
View(RHWO_year)
300
302
301
-
RHWO_11_year <- nc_count(species = 10060, region = list(bcr = "11"), year = c(2015, 2019))
0 commit comments