codes of local slopes by local regression

Hi there :slight_smile:

Can you provide us with a reprex (FAQ: How to do a minimal reproducible example ( reprex ) for beginners) so we can provide better help?