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

Plot: Creating a German map with risk_categories of XCTR WITH finanical data #30

Open
AnneSchoenauer opened this issue Jul 28, 2023 · 7 comments
Assignees
Labels
Milestone

Comments

@AnneSchoenauer
Copy link
Collaborator

AnneSchoenauer commented Jul 28, 2023

Dear @lindadelacombaz,

I would like to create a German map so that we can see for which regions we have more transition risk than for others. I found this plot here in the internet:

I think the depended variable would be XCTR_risk_category (the range would be from 0-1 to represent the % share of the risky products in the region) but depending on the region. We have postcodes in the data, which I think is granular enough (so no need to include street names).

I added in the toy dataset the column "D" which are random postcodes in Germany.

Image

Would be great if you finish with the sankey plot and the bar plots first for the XCTRs, then the map - priority would have WITH financial data and then thereafter WITHOUT financial data.

Thanks Linda, let me know if it is unclear!
All the best
Anne

@AnneSchoenauer
Copy link
Collaborator Author

Or like this one here:
image

@AnneSchoenauer
Copy link
Collaborator Author

Update:

  • the user would choose first a benchmark - then one map per benchmark
  • if we plot with financial data the user will chose first the scenario (worst, best, or equal weight)

@AnneSchoenauer AnneSchoenauer changed the title Plot: Creating a German map with risk_categories of XCTR without finanical data Plot: Creating a German map with risk_categories of XCTR WITH finanical data Aug 1, 2023
@lindadelacombaz
Copy link
Collaborator

  • Medium, Low and High :
  • User would choose one benchmark
  • User would choose a finance weight
  • Color scale from 0 - 1 : represents the risk categories percentage that the products are found in.
  • Priority : with financial data

@AnneSchoenauer
Copy link
Collaborator Author

Hey #tiltplot team !
@Anne Schoenauer
we talked about the fact that the banks cannot have access to internet while coding, whereas I use a Rstudio server because I use a package called "sf" that is quite complicated to install.
It is really hard to bypass the use of this package, since it is the main one to deal with maps or geographical data. I have done researches but in the end it still uses the sf package and it is always recommended to be used.
@Anne Schoenauer
We talked about creating a file that you can after read in the package, but I have realized that we still need the sf package to read the file since it will still contain geographical data. Moreover even if I use ggplot2, I use a specific function of ggplot2 called geom_sf(), that uses a sf object. (sorry if that seems unclear or gibberish ahah, but the main point is that I need it in every step of my code in my function basically)
It is not impossible to install the sf package in the system, as
@mauro
said in our tilt meeting, but it would be great to see how and the procedure to install the softwares required in the bank's system in order to install the sf package. (bearbeitet)
r-spatial.github.io
Simple Features for R
Support for simple features, a standardized way to
encode spatial vector data. Binds to GDAL for reading and writing
data, to GEOS for geometrical operations, and to PROJ for
projection conversions and datum transformations. Uses by default the s2
package for spherical geometry operations on ellipsoidal (long/lat) coordinates.

Thanks Linda for following up.
I explain a bit in this issue.
I am well aware that engaging banks IT is not easy, so most likely we'll need to have a few conversations with Anne and maybe the banks to learn how we can do it.
In the mean time, I would think of a way to make the mapping feature optional (see this issue and discuss with Anne when to prioritize it so I can help).

BTW,
@Linda Delacombaz
above you say the banks cannot have access to internet while coding, whereas I use a Rstudio server because I use a package called "sf".
Does the package request any data on the fly to an online service? If not, I think the solution does not require access to the internet. You use RStudio server via the internet but only because it's convenient. I use RStudio server locally via Docker, and could even avoid Docker if I had the dependencies installed in my laptop.
All the bank users need is a system with the dependencies listed in this Dockerfile. That system can be their laptops, and they can be offline (as long as the software is already in that system).

Looking into sf installation instructions I see that details are given for Mac and Linux but not Windows, so I wonder if for Windows users would experience any issue at all.
@Anne Schoenauer
what happens if you run this on your Windows computer?
install.packages("sf")
library(sf)
Also try installing with pak, as it's way smarter than install.packages() and can resolve system dependencies:

install.packages("pak")

pak::pak("sf")
library(sf)

Yeah, I think that pak solves the problem.
See this comment.
So I added installation instructions with pak. (bearbeitet)

@AnneSchoenauer
Copy link
Collaborator Author

@lindadelacombaz the package is installed and ready :) So let me know which code I should try out! :)

@lindadelacombaz
Copy link
Collaborator

lindadelacombaz commented Oct 17, 2023

Edit : Correct the financial data and create the german map subsequently

@AnneSchoenauer
Copy link
Collaborator Author

Dear @lindadelacombaz,
I created this Google Drive Document here so that we can discuss your email there.
Thanks a lot for pointing out the methodology!
Let me know if there is anything unclear.
Best
Anne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants