diff --git a/README.Rmd b/README.Rmd index 7df32df7e..e899f9526 100644 --- a/README.Rmd +++ b/README.Rmd @@ -27,13 +27,24 @@ This repository hosts only public code and may only show only fake data. ## Installation -You can install the development version of tiltIndicator from [GitHub](https://github.com/) with: +You can install the development version from +[r-universe](https://r-universe.dev/): ``` r -# install.packages("devtools") -devtools::install_github("2DegreesInvesting/tiltIndicator") +options(repos = c("https://2degreesinvesting.r-universe.dev", getOption("repos"))) +install.packages("tiltIndicator") ``` +Or from [GitHub](https://github.com/): + +``` r +# install.packages("pak") +pak::pak("2DegreesInvesting/tiltIndicator") +``` + +Having trouble? Try it on a fresh new project on +(free). + ## Example ```{r child=tiltIndicator:::template_to_rmd("example-emissions_profile.R")} diff --git a/README.md b/README.md index 3abd8c6a0..944c4dfe9 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,24 @@ This repository hosts only public code and may only show only fake data. ## Installation -You can install the development version of tiltIndicator from -[GitHub](https://github.com/) with: +You can install the development version from +[r-universe](https://r-universe.dev/): ``` r -# install.packages("devtools") -devtools::install_github("2DegreesInvesting/tiltIndicator") +options(repos = c("https://2degreesinvesting.r-universe.dev", getOption("repos"))) +install.packages("tiltIndicator") ``` +Or from [GitHub](https://github.com/): + +``` r +# install.packages("pak") +pak::pak("2DegreesInvesting/tiltIndicator") +``` + +Having trouble? Try it on a fresh new project on +(free). + ## Example ``` r @@ -36,57 +46,57 @@ library(readr) options(readr.show_col_types = FALSE) companies <- read_csv(toy_emissions_profile_any_companies()) -products <- read_csv(toy_emissions_profile_products()) +products <- read_csv(toy_emissions_profile_products_ecoinvent()) both <- emissions_profile(companies, products) both #> # A tibble: 72 × 3 -#> companies_id product company -#> -#> 1 antimonarchy_canine -#> 2 celestial_lovebird -#> 3 nonphilosophical_llama -#> 4 asteria_megalotomusquinquespinosus -#> 5 quasifaithful_amphiuma -#> 6 spectacular_americanriverotter -#> 7 contrite_silkworm -#> 8 harmless_owlbutterfly -#> 9 fascist_maiasaura -#> 10 charismatic_islandwhistler +#> companies_id product company +#> +#> 1 antimonarchy_canine +#> 2 celestial_lovebird +#> 3 nonphilosophical_llama +#> 4 asteria_megalotomusquinquespinosus +#> 5 quasifaithful_amphiuma +#> 6 spectacular_americanriverotter +#> 7 contrite_silkworm +#> 8 harmless_owlbutterfly +#> 9 fascist_maiasaura +#> 10 charismatic_islandwhistler #> # ℹ 62 more rows both |> unnest_product() -#> # A tibble: 72 × 7 -#> companies_id grouped_by risk_category profile_ranking clustered -#> -#> 1 antimonarchy_canine NA tent -#> 2 celestial_lovebird NA table hi… -#> 3 nonphilosophical_llama NA surface … -#> 4 asteria_megalotomusquinqu… NA tent -#> 5 quasifaithful_amphiuma NA tent -#> 6 spectacular_americanriver… NA open spa… -#> 7 contrite_silkworm NA tent -#> 8 harmless_owlbutterfly NA tent -#> 9 fascist_maiasaura NA tent -#> 10 charismatic_islandwhistler NA camper p… -#> # ℹ 62 more rows +#> # A tibble: 2,736 × 7 +#> companies_id grouped_by risk_category profile_ranking clustered +#> +#> 1 antimonarchy_canine all low 0.167 tent +#> 2 antimonarchy_canine all high 1 tent +#> 3 antimonarchy_canine all high 0.778 tent +#> 4 antimonarchy_canine all medium 0.667 tent +#> 5 antimonarchy_canine all low 0.0556 tent +#> 6 antimonarchy_canine all medium 0.611 tent +#> 7 antimonarchy_canine isic_4digit medium 0.5 tent +#> 8 antimonarchy_canine isic_4digit high 1 tent +#> 9 antimonarchy_canine isic_4digit low 0.333 tent +#> 10 antimonarchy_canine isic_4digit high 1 tent +#> # ℹ 2,726 more rows #> # ℹ 2 more variables: activity_uuid_product_uuid , co2_footprint both |> unnest_company() -#> # A tibble: 72 × 4 -#> companies_id grouped_by risk_category value -#> -#> 1 antimonarchy_canine NA -#> 2 celestial_lovebird NA -#> 3 nonphilosophical_llama NA -#> 4 asteria_megalotomusquinquespinosus NA -#> 5 quasifaithful_amphiuma NA -#> 6 spectacular_americanriverotter NA -#> 7 contrite_silkworm NA -#> 8 harmless_owlbutterfly NA -#> 9 fascist_maiasaura NA -#> 10 charismatic_islandwhistler NA -#> # ℹ 62 more rows +#> # A tibble: 1,296 × 4 +#> companies_id grouped_by risk_category value +#> +#> 1 antimonarchy_canine all high 0.333 +#> 2 antimonarchy_canine all medium 0.333 +#> 3 antimonarchy_canine all low 0.333 +#> 4 antimonarchy_canine isic_4digit high 0.5 +#> 5 antimonarchy_canine isic_4digit medium 0.167 +#> 6 antimonarchy_canine isic_4digit low 0.333 +#> 7 antimonarchy_canine tilt_sector high 0.5 +#> 8 antimonarchy_canine tilt_sector medium 0 +#> 9 antimonarchy_canine tilt_sector low 0.5 +#> 10 antimonarchy_canine unit high 0.5 +#> # ℹ 1,286 more rows ``` For more examples see [Get