Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

habitatsprings_updates: data source update @PatrikOosterlynck #40

Merged
merged 1 commit into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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