Adding ChatGPT to RStudio with the GPT Studio add-in package

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi friends welcome back to the channel I have a really exciting one for you today recently I did a video looking at our tutor.ai that was using the chat GPT engine to create our code and now someone has created GPT studio so GPT Studio brings that chat GPT power straight into rstudio for you I will link up to the GitHub site so you can access this information and have a go yourself if we come down there's a few instructions that we need to follow so you need to have an open AI account this is free I have just been working with the free one go to open AI you can just if you have a Google account you can even just single sign on with Google hitting sign in with Google otherwise create an account then follow the this link to the page where you generate API Keys you will need to generate an API key and this is the way that our studio is going to be able to talk to the open AI system so that it can run the code once you've got that key make sure you save it somewhere in R you are going to need to provide our studio with that key you can either do that with this line of code where API key will be the key that you have generated or you can do it by putting it in the uh Environ file and there is the code here in order to do that either of these will work you will then need to install this package that we're looking at here on GitHub so to do that you will need devtools installed and then you just run install GitHub and this line here one other thing that's not mentioned but I found that I needed to run was the open AI package so just in our studio go to install packages and find the open AI package I found that I needed that in addition to what is mentioned here on this page so what can this do it can do a few different things it can spell and grammar check so we just select a piece of code and we just choose spell check it will do that for us but more powerful than that it can write text and it can write code so just like with the r Tudor system we can specify some fairly basic instructions and it will generate code for us and the final thing it can do is we can get it to do kind of other things into the example here it can do translation I I've tried translating English to Russian and back again and seems to a pretty reasonable job of that it's probably not the main thing you'll be looking at though so let's jump over to our studio and have a look okay so we're here in our studio I've just got a template quarter document up and if we come up here add-ins and we can see that amongst our add-ins we now have the GPT Studio ones if you don't see this then we can come up to tools add-ins browse add-ins and we can access them there but for most of you once you've installed it you may need to restart our studio they should just appear and that add-ins drop down otherwise we see them there though and so if we have a go got a line where I somehow forgot to spell let's see how it does it just fixes it all up worked really nicely that's nice handy to have but really what we want to be able to do is we want to just be able to give instructions so let's do a histogram of MPG variable from empty cars using ggplot I would like that to be some R code please takes a second but we can see there it's calling Library ggplot which it needs empty cars it's got the correct variable uh it's decided to do a bit of coloring it's a color and fill that we might adjust if we like it's giving it labels title so it has just written that code for us so just like with the r tutor AI it is making that call and chat GPT is pretty scarily good with writing particularly if we give it clear instructions and we're not getting too fancy with things it is really good similarly if we wanted to then get it to write a few sentences we've given instructions on that as well that is GPT Studio adding as an add-in into rstudio so now you can just access these tools as you are doing your analysis it is going to really be such a game changer and as I mentioned in the uh tutor video really it's It's Gonna Come Close eventually to putting people like me out of a job where you will just be able to call up the expertise of this AI engine and despite my 25 years with r it is going to beat me hands down so I hope this was helpful I think you will get a lot of value out of putting GPT studio if you have found this helpful please hit like subscribe if you're not already a subscriber and I will see you again for more statistics ah and random stuff
Info
Channel: Dr Lyndon Walker
Views: 33,470
Rating: undefined out of 5
Keywords: research, phd, degree, thesis, dissertation, statistics, data, academic writing, journal article, masters, chat gpt, rstudio, rstats, gpt studio, ai coding, r code, ai auto code for r, chat gpt writes r code, posit
Id: QQfDTLExoNU
Channel Id: undefined
Length: 5min 40sec (340 seconds)
Published: Thu Dec 29 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.