Real-space methods for calculating the electronic response of 2D materials