Skip to content

Commit 30cbbc7

Browse files
author
Mauro Lepore
authored
prepare 0.2.2 (#260)
* Update docs * Style * Update revdepcheck results
1 parent 5cf6367 commit 30cbbc7

File tree

7 files changed

+105
-33
lines changed

7 files changed

+105
-33
lines changed

data-raw/ald_demo.R

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ generate_lei <- function(id) {
2525
paste0,
2626
replicate(2, sample(0:9, 1, TRUE), FALSE)
2727
)
28-
})
28+
}
29+
)
2930

3031
paste0(four, "00", twelve, two)
3132
}
@@ -46,8 +47,8 @@ ald_aviation <- ald_aviation %>%
4647
# normalize the data
4748
.x = production,
4849
.y = emission_factor,
49-
production = (.x - min(.x))/(max(.x) - min(.x)),
50-
emission_factor = (.y - min(.y))/(max(.y) - min(.y)),
50+
production = (.x - min(.x)) / (max(.x) - min(.x)),
51+
emission_factor = (.y - min(.y)) / (max(.y) - min(.y)),
5152
.x = NULL,
5253
.y = NULL
5354
)
@@ -67,16 +68,16 @@ ald_aviation <- ald_aviation %>%
6768
# hdv ---------------------------------------------------------------------
6869
hdv_name_bridge <- tibble::tribble(
6970
~name_company, ~name_company_hdv,
70-
"aston martin", "scania",
71-
"avtozaz", "man",
72-
"bogdan", "iveco",
73-
"ch auto", "paccar inc",
74-
"chehejia", "hino",
75-
"chtc auto", "volvo group",
76-
"dongfeng honda", "navistar",
77-
"dongfeng-luxgen", "dongfeng",
78-
"electric mobility solutions", "tata motors",
79-
"faraday future", "daimler"
71+
"aston martin", "scania",
72+
"avtozaz", "man",
73+
"bogdan", "iveco",
74+
"ch auto", "paccar inc",
75+
"chehejia", "hino",
76+
"chtc auto", "volvo group",
77+
"dongfeng honda", "navistar",
78+
"dongfeng-luxgen", "dongfeng",
79+
"electric mobility solutions", "tata motors",
80+
"faraday future", "daimler"
8081
)
8182

8283
ald_hdv <- ald_demo %>%
@@ -97,7 +98,7 @@ ald_hdv <- ald_hdv %>%
9798
dplyr::mutate(
9899
# normalize the data
99100
.x = production,
100-
production = (.x - min(.x))/(max(.x) - min(.x)),
101+
production = (.x - min(.x)) / (max(.x) - min(.x)),
101102
emission_factor = NA,
102103
.x = NULL,
103104
)
@@ -132,7 +133,7 @@ ald_demo <- ald_demo %>%
132133
) %>%
133134
ungroup()
134135

135-
#ensure reproducibility of random identifiers
136+
# ensure reproducibility of random identifiers
136137
withr::with_seed(
137138
42,
138139
{
@@ -145,7 +146,8 @@ withr::with_seed(
145146
# assume LEIs for about 50% of companies
146147
slice_sample(prop = 0.5) %>%
147148
mutate(lei = vgenerate_lei(id_company))
148-
})
149+
}
150+
)
149151

150152
ald_demo <- ald_demo %>%
151153
left_join(leis, by = "id_company")
@@ -165,7 +167,7 @@ ordered_names <- c(
165167
"is_ultimate_owner",
166168
"ald_timestamp",
167169
emission_factor_unit = "ald_emission_factor_unit"
168-
)
170+
)
169171

170172
ald_demo <- select(ald_demo, ordered_names)
171173

data-raw/region_isos.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ exclude_values <- function(data, values, .region) {
9292
}
9393

9494
process_countries <- function(data, ald_isos, source_year) {
95-
9695
data %>%
9796
pick_type("country_name") %>%
9897
rbind(global_data(., source_year)) %>%
@@ -230,7 +229,7 @@ region_isos_nze_2021 <- process_countries(
230229
region_data,
231230
ald_isos,
232231
source_year
233-
)
232+
)
234233

235234
# Combine -----------------------------------------------------------------
236235

man/region_isos.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

revdep/README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,28 @@
22

33
|field |value |
44
|:--------|:----------------------------|
5-
|version |R version 4.0.3 (2020-10-10) |
6-
|os |macOS Big Sur 10.16 |
7-
|system |x86_64, darwin17.0 |
8-
|ui |RStudio |
5+
|version |R version 4.1.1 (2021-08-10) |
6+
|os |Ubuntu 20.04.3 LTS |
7+
|system |x86_64, linux-gnu |
8+
|ui |X11 |
99
|language |(EN) |
10-
|collate |en_CA.UTF-8 |
11-
|ctype |en_CA.UTF-8 |
12-
|tz |Europe/Berlin |
13-
|date |2021-07-09 |
10+
|collate |en_US.UTF-8 |
11+
|ctype |en_US.UTF-8 |
12+
|tz |America/Los_Angeles |
13+
|date |2021-09-03 |
1414

1515
# Dependencies
1616

1717
|package |old |new |Δ |
1818
|:----------|:-----|:----------|:--|
19-
|r2dii.data |0.2.0 |0.2.0.9000 |* |
19+
|r2dii.data |0.2.1 |0.2.1.9000 |* |
2020

2121
# Revdeps
2222

23+
## Failed to check (2)
24+
25+
|package |version |error |warning |note |
26+
|:--------------|:-------|:-----|:-------|:----|
27+
|r2dii.analysis |? | | | |
28+
|r2dii.plot |? | | | |
29+

revdep/failures.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
*Wow, no problems at all. :)*
1+
# r2dii.analysis
2+
3+
<details>
4+
5+
* Version:
6+
* GitHub: https://github.com/2DegreesInvesting/r2dii.data
7+
* Source code: NA
8+
* Number of recursive dependencies: 0
9+
10+
</details>
11+
12+
## Error before installation
13+
14+
### Devel
15+
16+
```
17+
18+
19+
20+
21+
22+
23+
```
24+
### CRAN
25+
26+
```
27+
28+
29+
30+
31+
32+
33+
```
34+
# r2dii.plot
35+
36+
<details>
37+
38+
* Version:
39+
* GitHub: https://github.com/2DegreesInvesting/r2dii.data
40+
* Source code: NA
41+
* Number of recursive dependencies: 0
42+
43+
</details>
44+
45+
## Error before installation
46+
47+
### Devel
48+
49+
```
50+
51+
52+
53+
54+
55+
56+
```
57+
### CRAN
58+
59+
```
60+
61+
62+
63+
64+
65+
66+
```

tests/testthat/test-classification_bridge.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ test_that("In classification datasets, `code` is of type 'character' (#185)", {
2727
types <- unlist(lapply(datasets, function(x) typeof(x[["code"]])))
2828
expect_equal(unique(types), "character")
2929
})
30-

tests/testthat/test-region_isos.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test_that("outputs expected regions for weo_2020 (#253).", {
5151
"non opec"
5252
)
5353

54-
region_isos_weo_2020 <- region_isos[region_isos$source == "weo_2020",]
54+
region_isos_weo_2020 <- region_isos[region_isos$source == "weo_2020", ]
5555

5656
expect_equal(
5757
sort(unique(region_isos_weo_2020$region)),
@@ -74,7 +74,7 @@ test_that("outputs expected regions for isf_2020 (#253).", {
7474
"oecd pacific"
7575
)
7676

77-
region_isos_isf_2020 <- region_isos[region_isos$source == "isf_2020",]
77+
region_isos_isf_2020 <- region_isos[region_isos$source == "isf_2020", ]
7878

7979
expect_equal(
8080
sort(unique(region_isos_isf_2020$region)),

0 commit comments

Comments
 (0)