Skip to content

Commit c0e7cca

Browse files
committed
Cut and Drop JRC_1K_POP_2018.tif
1 parent 50d9cb3 commit c0e7cca

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

vignettes/JRC_1K_POP_2018.tif

-3.99 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.

vignettes/JRC_1K_POP_2018_NO.rds

129 KB
Binary file not shown.

vignettes/nuts.Rmd

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pat_n2_mhab_12_no <- pat_n2 %>%
276276
filter(unit == "P_MHAB") %>% # Patents per one million inhabitants
277277
filter(time == 2012) %>% # 2012
278278
filter(str_detect(geo, "^NO")) %>% # Norway
279-
select(-unit)
279+
dplyr::select(-unit)
280280
281281
# Classifying the Data
282282
pat_classified <- nuts_classify(
@@ -795,10 +795,10 @@ In addition to tracing the evolution of NUTS codes, the table contains **flows**
795795
```{r, echo=FALSE, message = FALSE, warning = FALSE, fig.cap= "Alluvial plot illustrating area size flows; Created using the [ggalluvial](https://corybrunson.github.io/ggalluvial/) package.", fig.alt ="The alluvial plot shows population flows from NUTS version 2016 to 2021."}
796796
# Add names
797797
no_2016_names <- read_sf("shapefiles/NUTS_RG_20M_2016_3857_NO.shp") %>%
798-
select(from_code = NUTS_ID, from_name = NUTS_NAME) %>%
798+
dplyr::select(from_code = NUTS_ID, from_name = NUTS_NAME) %>%
799799
st_set_geometry(NULL)
800800
no_2021_names <- read_sf("shapefiles/NUTS_RG_20M_2021_3857_NO.shp") %>%
801-
select(to_code = NUTS_ID, to_name = NUTS_NAME) %>%
801+
dplyr::select(to_code = NUTS_ID, to_name = NUTS_NAME) %>%
802802
st_set_geometry(NULL)
803803
804804
no_walks <- no_walks %>%
@@ -831,13 +831,18 @@ To illustrate the main idea, the map below showcases **population densities** ac
831831

832832
```{r, echo=FALSE, message = FALSE, warning = FALSE, out.width = "100%", fig.width = 7, fig.cap= "Spatial distribution of population and boundary changes; Sources: [Shapefiles](https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts) and [population raster](https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/population-distribution-demography/geostat) from EUROSTAT; Created using the [sf](https://r-spatial.github.io/sf/) and the [terra](https://rspatial.github.io/terra/reference/terra-package.html) packages.", fig.alt ="Two maps of Southern Norway with very granular population density and administrative boundaries of the 2016 and 2021 NUTS version. The region with the capital Olso and its adjacent region are highlighted in version 2016 that both contribute to a larger single region in version 2021."}
833833
834-
pop <- raster("JRC_1K_POP_2018.tif")
835-
no_2016_1 <- no_2016 %>% st_transform(crs(pop))
836-
no_2021_1 <- no_2021 %>% st_transform(crs(pop))
837-
no_pop <- crop(x = pop, y = as_Spatial(no_2016_1))
838-
no_pop <- mask(no_pop, as_Spatial(no_2016_1))
839-
no_pop_df <- as.data.frame(no_pop, xy = TRUE) %>%
840-
filter(!is.na(JRC_1K_POP_2018))
834+
# pop <- raster("JRC_1K_POP_2018.tif")
835+
# no_2016_1 <- no_2016 %>% st_transform(crs(pop))
836+
# saveRDS( no_2016_1 , 'JRC_1K_POP_2018_2016_transformed_NO.rds' )
837+
# no_2021_1 <- no_2021 %>% st_transform(crs(pop))
838+
# saveRDS( no_2021_1 , 'JRC_1K_POP_2018_2021_transformed_NO.rds' )
839+
# no_pop <- crop(x = pop, y = as_Spatial(no_2016_1))
840+
# no_pop <- mask(no_pop, as_Spatial(no_2016_1))
841+
# no_pop_df <- as.data.frame(no_pop, xy = TRUE) %>%
842+
# filter(!is.na(JRC_1K_POP_2018))
843+
no_pop_df <- readRDS( 'JRC_1K_POP_2018_NO.rds' )
844+
no_2016_1 <- readRDS( 'JRC_1K_POP_2018_2016_transformed_NO.rds' )
845+
no_2021_1 <- readRDS( 'JRC_1K_POP_2018_2021_transformed_NO.rds' )
841846
842847
c=500000
843848
d=500000

0 commit comments

Comments
 (0)