ChatGPT continues to amaze! A few weeks ago, I spent about 4 hours writing an R Shiny app that plotted a normal distribution by internally calling some Fortran code to calculate the distribution. ChatGPT has managed to reproduce that in just a few minutes!
Firstly, I prompted it with pretty much the description from the previous tweet. It gave me the boilerplate R Shiny code with a commented line telling me where my Fortran code should go.
So far so good, but what about the Fortran code? I asked for help with this, and it gave me a function to calculate a normal distribution, evenly helpfully reminding me where this goes in the R Shiny code.
Hold on though, it's telling me to replace the "# Fortran code goes here". I can't just place Fortran code in an R script and expect it to work. Maybe this is ChatGPT's limitation. Let's point it and see what it has to say.
Woah, it gave me pretty detailed instructions of how to call the Fortran code from R! You can go further than this, e.g. asking it to bring the code together gives an answer so the full R script.
This is seriously impressive. When I tackled this problem a few weeks back, I'd never created an R Shiny app before, or called Fortran from R, so had to do lots of searching. ChatGPT here has basically removed that step!
@samharrison7 wow, yet another impressive ChatGPT example! I'm really going to have to give it a try. Wondering how it will stack up to thorny problems with lots of dependencies.
@mattasdata Yeah complex dependencies will be interesting. You can ask it things like "how do I install the dependencies for this?" and it will give you pip, conda, apt commands etc, but I haven't tried it with anything other than simple things.
@mattasdata Yeah complex dependencies will be interesting. You can ask it things like "how do I install the dependencies for this?" and it will give you pip, conda, apt commands etc, but I haven't tried it with anything other than simple things.