Skip to content

Commit

Permalink
Merge pull request #40 from inbo/habsprings
Browse files Browse the repository at this point in the history
habitatsprings_updates: data source update @Patrikoosterlynck
  • Loading branch information
florisvdh authored May 4, 2020
2 parents c79a7bb + 305b6e7 commit 918b8cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ hs_gs %>%
Setting tab name:

```{r eval=FALSE}
ws_name <- "2020-02-07"
ws_name <- "2020-04-29"
```

Reading the information:
Expand All @@ -74,17 +74,6 @@ hs_attr_new <-
arrange(id)
```

Compare columns that should match: are they still the same?

```{r}
hs_attr %>%
mutate(X = X %>% `attributes<-`(NULL),
Y = Y %>% `attributes<-`(NULL)
) %>%
all.equal(hs_attr_new[,1:10])
# TRUE
```

Inspecting and rearranging column order:

```{r eval=FALSE}
Expand All @@ -99,6 +88,17 @@ hs_attr_new %>%
glimpse
```

Compare columns that should match: are they still the same?

```{r}
hs_attr %>%
mutate(X = X %>% `attributes<-`(NULL),
Y = Y %>% `attributes<-`(NULL)
) %>%
all.equal(hs_attr_new)
# [1] "Different number of rows"
```


### Overwrite tsv file

Expand All @@ -112,12 +112,10 @@ hs_attr_new %>%
```{r eval=FALSE, paged.print=FALSE}
habitatsprings_new <-
habitatsprings %>%
bind_cols(hs_attr_new %>% select(system_type, unit_id)) %>%
select(1:4,
system_type,
habitattype,
unit_id,
everything())
rbind(hs_attr_new %>%
slice(n() - 1, n()) %>%
st_as_sf(coords = c("X", "Y"),
crs = 4326))
habitatsprings_new
```

Expand Down
2 changes: 2 additions & 0 deletions src/generate_habitatsprings_updates/data/hs_attr.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ id source validity_status name system_type habitattype unit_id area_m2 year sbz
100 habkaart te controleren NA unknown 7220,gh 51 0 0 0 3.6371136 50.7384927
101 habkaart te controleren NA unknown 7220,gh 52 0 0 0 5.4052919 50.7954385
102 habkaart te controleren NA unknown 7220,gh 53 0 0 0 4.2872162 50.7118851
103 kalktufproject gecontroleerd Kwinten 2 NA 7230 NA 0 2014 1 5.811475 50.751384
104 kalktufproject gecontroleerd Krindaal 2 rivulet 7220 3 100 2014 1 5.832216 50.745716

0 comments on commit 918b8cf

Please sign in to comment.